Reviewed by Darin.
- http://bugs.webkit.org/show_bug.cgi?id=13350
Build Ahem into DumpRenderTree
* DumpRenderTree/DumpRenderTree.m:
(activateAhemFont): Added. Activates the copy of Ahem included in the
DumpRenderTree binary.
(dumpRenderTree): Replaced the check that Ahem is available with a call
to activateAhemFont().
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
Added linker options to include Ahem in the data section of the
DumpRenderTree binary.
2007-04-21 Mitz Pettel <mitz@webkit.org>
Reviewed by Darin.
- http://bugs.webkit.org/show_bug.cgi?id=13350
Build Ahem into DumpRenderTree
* quality/testing.html: Removed the requirement to download and install
Ahem for running the tests.
* quality/testwriting.html: Added information about Ahem.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20994
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-04-21 Mitz Pettel <mitz@webkit.org>
+
+ Reviewed by Darin.
+
+ - http://bugs.webkit.org/show_bug.cgi?id=13350
+ Build Ahem into DumpRenderTree
+
+ * quality/testing.html: Removed the requirement to download and install
+ Ahem for running the tests.
+ * quality/testwriting.html: Added information about Ahem.
+
2007-04-09 Adele Peterson <adele@apple.com>
* blog/wp-content/chrome.jpg: Added.
<h3>The WebKit Tests</h3>
-<p>Before patches can land in any of the frameworks in the repository, the layout regression tests must be run. To run these tests, do the following:</p>
-
-<ol>
-<li><p>Download the <a href="Ahem.ttf">Ahem font</a>.</p>
-<p>This special simple font is used to construct certain types of predictable tests. <a href="http://www.hixie.ch/resources/fonts/">A page on Ian Hickson's site</a> has a more detailed explanation.</p></li>
-<li><p>Open the downloaded file in the Font Book application and click on the Install Font button to install it.</p></li>
-<li><p>Execute the <tt>run-webkit-tests</tt> script.</p>
+<p>Before patches can land in any of the frameworks in the repository, the layout regression tests must be run. To run these tests, execute the <tt>run-webkit-tests</tt> script.</p>
<p class="code">WebKitTools/Scripts/run-webkit-tests</p>
-<p>It's handy to put the <tt>WebKitTools/Scripts</tt> directory in your shell path so you can type commands like <tt>build-webkit</tt> without specifying the path to the script.</p>
-</li>
-</ol>
+<p>It's handy to put the <tt>WebKitTools/Scripts</tt> directory in your shell path so you can type commands like <tt>run-webkit-tests</tt> without specifying the path to the script.</p>
<p>The script will dump the render trees for all of the pages and diff the results against the expected correct results. If no
differences are found, then the patch has passed the tests. If any tests fail, then the patch cannot be committed until the
<ol>
<li>The test should be the smallest possible code fragment that tests the feature.
-<li>The test should fit on one page (unless of course it's testing scrolling).
+<li>The test should fit on one page (unless of course it’s testing scrolling).
<li>The test should clearly describe what feature it is testing.
<li>The test should clearly describe the expected result. It should be possible through visual inspection alone to determine that the test has
failed.
This is useful for tests that are testing something other than layout. The event creation test mentioned above is a good example of
how to do this and when it makes sense.</p>
+<p><a href="http://www.hixie.ch/resources/fonts/">The Ahem font</a> is useful in testing text layout, since its
+glyphs’ metrics are well known, and it is always available to tests running
+in the layout test tool. However, if you want to view tests that use Ahem in Safari,
+you should <a href="Ahem.ttf">download Ahem</a>, open it in the Font Book
+application, and click on the Install Font button to install it.</p>
+
<p>The CSS working group has an excellent document on <a href="http://www.w3.org/Style/CSS/Test/guidelines.html">test writing guidelines</a> for CSS tests. <a href="http://trac.webkit.org/projects/webkit/wiki/Writing%20Layout%20Tests%20for%20DumpRenderTree">This wiki article</a> has more information on writing good tests and the DumpRenderTree tool.</p>
<?php
+2007-04-21 Mitz Pettel <mitz@webkit.org>
+
+ Reviewed by Darin.
+
+ - http://bugs.webkit.org/show_bug.cgi?id=13350
+ Build Ahem into DumpRenderTree
+
+ * DumpRenderTree/DumpRenderTree.m:
+ (activateAhemFont): Added. Activates the copy of Ahem included in the
+ DumpRenderTree binary.
+ (dumpRenderTree): Replaced the check that Ahem is available with a call
+ to activateAhemFont().
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ Added linker options to include Ahem in the data section of the
+ DumpRenderTree binary.
+
2007-04-20 Adam Roben <aroben@apple.com>
Reviewed by Darin.
#import <WebKit/WebViewPrivate.h>
#import <JavaScriptCore/Assertions.h>
#import <getopt.h>
+#import <mach-o/getsect.h>
#import <malloc/malloc.h>
#import <objc/objc-runtime.h> // for class_poseAs
#import <pthread.h>
exit(128 + sig);
}
+static void activateAhemFont(void)
+{
+ unsigned long fontDataLength;
+ char* fontData = getsectdata("__DATA", "Ahem", &fontDataLength);
+ if (!fontData) {
+ fprintf(stderr, "Failed to locate the Ahem font.\n");
+ exit(1);
+ }
+
+ ATSFontContainerRef fontContainer;
+ OSStatus status = ATSFontActivateFromMemory(fontData, fontDataLength, kATSFontContextLocal, kATSFontFormatUnspecified, NULL, kATSOptionFlagsDefault, &fontContainer);
+
+ if (status != noErr) {
+ fprintf(stderr, "Failed to activate the Ahem font.\n");
+ exit(1);
+ }
+}
+
static void setDefaultColorProfileToRGB(void)
{
CMProfileRef genericProfile = [[NSColorSpace genericRGBColorSpace] colorSyncProfile];
exit(1);
break;
}
-
- if ([[[NSFontManager sharedFontManager] availableMembersOfFontFamily:@"Ahem"] count] == 0) {
- fprintf(stderr, "\nAhem font is not available. This special simple font is used to construct certain types of predictable tests.\n\nTo run regression tests, please get it from <http://webkit.org/quality/Ahem.ttf>.\n");
- exit(1);
- }
-
+
+ activateAhemFont();
+
if (dumpPixels) {
setDefaultColorProfileToRGB();
screenCaptureBuffer = malloc(maxViewHeight * maxViewWidth * 4);
22181BCF09DC8C4B008342E8 /* ObjCPluginFunction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ObjCPluginFunction.h; sourceTree = "<group>"; };
22181BD009DC8C4B008342E8 /* ObjCPluginFunction.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ObjCPluginFunction.m; sourceTree = "<group>"; };
32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; };
+ 9345229C0BD12B710086EDA0 /* AHEM____.TTF */ = {isa = PBXFileReference; explicitFileType = file; name = AHEM____.TTF; path = DumpRenderTree.qtproj/fonts/AHEM____.TTF; sourceTree = "<group>"; };
9335435F03D75502008635CE /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9340995408540CAF007F3BC8 /* DumpRenderTree */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DumpRenderTree; sourceTree = BUILT_PRODUCTS_DIR; };
93442CF408F8BA4900BFE8CA /* TextInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputController.h; sourceTree = "<group>"; };
32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */,
1422A2750AF6F4BD00E1A883 /* Delegates */,
1422A2690AF6F45200E1A883 /* Controllers */,
+ 9345229B0BD12B2C0086EDA0 /* Resources */,
141BF1F5096A439800E0753C /* TestNetscapePlugIn.subproj */,
A803FF7409CAAD08009B2A37 /* DumpRenderTree.h */,
08FB7796FE84155DC02AAC07 /* DumpRenderTree.m */,
name = Delegates;
sourceTree = "<group>";
};
+ 9345229B0BD12B2C0086EDA0 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 9345229C0BD12B710086EDA0 /* AHEM____.TTF */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
9340995508540CAF007F3BC8 /* Products */ = {
isa = PBXGroup;
children = (
isa = XCBuildConfiguration;
buildSettings = {
GCC_PREFIX_HEADER = DumpRenderTreePrefix.h;
+ OTHER_LDFLAGS = (
+ "-sectcreate",
+ __DATA,
+ Ahem,
+ DumpRenderTree.qtproj/fonts/AHEM____.TTF,
+ );
PRODUCT_NAME = DumpRenderTree;
};
name = Debug;
isa = XCBuildConfiguration;
buildSettings = {
GCC_PREFIX_HEADER = DumpRenderTreePrefix.h;
+ OTHER_LDFLAGS = (
+ "-sectcreate",
+ __DATA,
+ Ahem,
+ DumpRenderTree.qtproj/fonts/AHEM____.TTF,
+ );
PRODUCT_NAME = DumpRenderTree;
};
name = Release;