Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2526)

Unified Diff: webkit/tools/test_shell/test_shell.cc

Issue 10107014: Migrate WebKit "global script" font prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix after sync Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« webkit/glue/webpreferences.cc ('K') | « webkit/glue/webpreferences.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_shell.cc
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 07f57a6fb8c72eda43d7e8adac0804bb5b9d65a2..cbf3546ecff437e4bada83f7cdf7b9243656819c 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -6,6 +6,8 @@
#include "webkit/tools/test_shell/test_shell.h"
+#include <unicode/uscript.h>
viettrungluu 2012/05/16 13:27:58 "
falken 2012/05/17 07:08:41 Removed this as now it uses WebPreferences::kCommo
+
#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/debug/debug_on_start_win.h"
@@ -79,6 +81,8 @@ const int kTestWindowHeight = 600;
const int kSVGTestWindowWidth = 480;
const int kSVGTestWindowHeight = 360;
+const char* kCommonScript = uscript_getShortName(USCRIPT_COMMON);
viettrungluu 2012/05/16 13:27:58 " (even if no one cares about test_shell)
falken 2012/05/17 07:08:41 Done.
+
// URLRequestTestShellFileJob is used to serve the inspector
class URLRequestTestShellFileJob : public net::URLRequestFileJob {
public:
@@ -301,13 +305,17 @@ void TestShell::ResetWebPreferences() {
*web_prefs_ = WebPreferences();
#if defined(OS_MACOSX)
- web_prefs_->serif_font_family = ASCIIToUTF16("Times");
- web_prefs_->cursive_font_family = ASCIIToUTF16("Apple Chancery");
- web_prefs_->fantasy_font_family = ASCIIToUTF16("Papyrus");
+ web_prefs_->serif_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Times");
+ web_prefs_->cursive_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Apple Chancery");
+ web_prefs_->fantasy_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Papyrus");
#else
// NOTE: case matters here, this must be 'times new roman', else
// some layout tests fail.
- web_prefs_->serif_font_family = ASCIIToUTF16("times new roman");
+ web_prefs_->serif_font_family_map[kCommonScript] =
+ ASCIIToUTF16("times new roman");
// These two fonts are picked from the intersection of
// Win XP font list and Vista font list :
@@ -319,12 +327,17 @@ void TestShell::ResetWebPreferences() {
// They (especially Impact for fantasy) are not typical cursive
// and fantasy fonts, but it should not matter for layout tests
// as long as they're available.
- web_prefs_->cursive_font_family = ASCIIToUTF16("Comic Sans MS");
- web_prefs_->fantasy_font_family = ASCIIToUTF16("Impact");
+ web_prefs_->cursive_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Comic Sans MS");
+ web_prefs_->fantasy_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Impact");
#endif
- web_prefs_->standard_font_family = web_prefs_->serif_font_family;
- web_prefs_->fixed_font_family = ASCIIToUTF16("Courier");
- web_prefs_->sans_serif_font_family = ASCIIToUTF16("Helvetica");
+ web_prefs_->standard_font_family_map[kCommonScript] =
+ web_prefs_->serif_font_family_map[kCommonScript];
+ web_prefs_->fixed_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Courier");
+ web_prefs_->sans_serif_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Helvetica");
web_prefs_->default_encoding = "ISO-8859-1";
web_prefs_->default_font_size = 16;
« webkit/glue/webpreferences.cc ('K') | « webkit/glue/webpreferences.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698