OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #undef LOG | 5 #undef LOG |
6 | 6 |
7 #include "webkit/tools/test_shell/test_shell.h" | 7 #include "webkit/tools/test_shell/test_shell.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 // static | 294 // static |
295 void TestShell::ResetWebPreferences() { | 295 void TestShell::ResetWebPreferences() { |
296 DCHECK(web_prefs_); | 296 DCHECK(web_prefs_); |
297 | 297 |
298 // Match the settings used by Mac DumpRenderTree, with the exception of | 298 // Match the settings used by Mac DumpRenderTree, with the exception of |
299 // fonts. | 299 // fonts. |
300 if (web_prefs_) { | 300 if (web_prefs_) { |
301 *web_prefs_ = WebPreferences(); | 301 *web_prefs_ = WebPreferences(); |
302 | 302 |
303 #if defined(OS_MACOSX) | 303 #if defined(OS_MACOSX) |
304 web_prefs_->serif_font_family = ASCIIToUTF16("Times"); | 304 web_prefs_->serif_font_family_map[WebPreferences::kCommonScript] = |
305 web_prefs_->cursive_font_family = ASCIIToUTF16("Apple Chancery"); | 305 ASCIIToUTF16("Times"); |
306 web_prefs_->fantasy_font_family = ASCIIToUTF16("Papyrus"); | 306 web_prefs_->cursive_font_family_map[WebPreferences::kCommonScript] = |
| 307 ASCIIToUTF16("Apple Chancery"); |
| 308 web_prefs_->fantasy_font_family_map[WebPreferences::kCommonScript] = |
| 309 ASCIIToUTF16("Papyrus"); |
307 #else | 310 #else |
308 // NOTE: case matters here, this must be 'times new roman', else | 311 // NOTE: case matters here, this must be 'times new roman', else |
309 // some layout tests fail. | 312 // some layout tests fail. |
310 web_prefs_->serif_font_family = ASCIIToUTF16("times new roman"); | 313 web_prefs_->serif_font_family_map[WebPreferences::kCommonScript] = |
| 314 ASCIIToUTF16("times new roman"); |
311 | 315 |
312 // These two fonts are picked from the intersection of | 316 // These two fonts are picked from the intersection of |
313 // Win XP font list and Vista font list : | 317 // Win XP font list and Vista font list : |
314 // http://www.microsoft.com/typography/fonts/winxp.htm | 318 // http://www.microsoft.com/typography/fonts/winxp.htm |
315 // http://blogs.msdn.com/michkap/archive/2006/04/04/567881.aspx | 319 // http://blogs.msdn.com/michkap/archive/2006/04/04/567881.aspx |
316 // Some of them are installed only with CJK and complex script | 320 // Some of them are installed only with CJK and complex script |
317 // support enabled on Windows XP and are out of consideration here. | 321 // support enabled on Windows XP and are out of consideration here. |
318 // (although we enabled both on our buildbots.) | 322 // (although we enabled both on our buildbots.) |
319 // They (especially Impact for fantasy) are not typical cursive | 323 // They (especially Impact for fantasy) are not typical cursive |
320 // and fantasy fonts, but it should not matter for layout tests | 324 // and fantasy fonts, but it should not matter for layout tests |
321 // as long as they're available. | 325 // as long as they're available. |
322 web_prefs_->cursive_font_family = ASCIIToUTF16("Comic Sans MS"); | 326 web_prefs_->cursive_font_family_map[WebPreferences::kCommonScript] = |
323 web_prefs_->fantasy_font_family = ASCIIToUTF16("Impact"); | 327 ASCIIToUTF16("Comic Sans MS"); |
| 328 web_prefs_->fantasy_font_family_map[WebPreferences::kCommonScript] = |
| 329 ASCIIToUTF16("Impact"); |
324 #endif | 330 #endif |
325 web_prefs_->standard_font_family = web_prefs_->serif_font_family; | 331 web_prefs_->standard_font_family_map[WebPreferences::kCommonScript] = |
326 web_prefs_->fixed_font_family = ASCIIToUTF16("Courier"); | 332 web_prefs_->serif_font_family_map[WebPreferences::kCommonScript]; |
327 web_prefs_->sans_serif_font_family = ASCIIToUTF16("Helvetica"); | 333 web_prefs_->fixed_font_family_map[WebPreferences::kCommonScript] = |
| 334 ASCIIToUTF16("Courier"); |
| 335 web_prefs_->sans_serif_font_family_map[WebPreferences::kCommonScript] = |
| 336 ASCIIToUTF16("Helvetica"); |
328 | 337 |
329 web_prefs_->default_encoding = "ISO-8859-1"; | 338 web_prefs_->default_encoding = "ISO-8859-1"; |
330 web_prefs_->default_font_size = 16; | 339 web_prefs_->default_font_size = 16; |
331 web_prefs_->default_fixed_font_size = 13; | 340 web_prefs_->default_fixed_font_size = 13; |
332 web_prefs_->minimum_font_size = 0; | 341 web_prefs_->minimum_font_size = 0; |
333 web_prefs_->minimum_logical_font_size = 9; | 342 web_prefs_->minimum_logical_font_size = 9; |
334 web_prefs_->javascript_can_open_windows_automatically = true; | 343 web_prefs_->javascript_can_open_windows_automatically = true; |
335 web_prefs_->dom_paste_enabled = true; | 344 web_prefs_->dom_paste_enabled = true; |
336 web_prefs_->developer_extras_enabled = !layout_test_mode_ || | 345 web_prefs_->developer_extras_enabled = !layout_test_mode_ || |
337 developer_extras_enabled_; | 346 developer_extras_enabled_; |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 return device_orientation_client_mock_.get(); | 615 return device_orientation_client_mock_.get(); |
607 } | 616 } |
608 | 617 |
609 WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() { | 618 WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() { |
610 if (!geolocation_client_mock_.get()) { | 619 if (!geolocation_client_mock_.get()) { |
611 geolocation_client_mock_.reset( | 620 geolocation_client_mock_.reset( |
612 WebKit::WebGeolocationClientMock::create()); | 621 WebKit::WebGeolocationClientMock::create()); |
613 } | 622 } |
614 return geolocation_client_mock_.get(); | 623 return geolocation_client_mock_.get(); |
615 } | 624 } |
OLD | NEW |