| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // Initialize static member variable | 108 // Initialize static member variable |
| 109 WindowList* TestShell::window_list_; | 109 WindowList* TestShell::window_list_; |
| 110 WebPreferences* TestShell::web_prefs_ = NULL; | 110 WebPreferences* TestShell::web_prefs_ = NULL; |
| 111 bool TestShell::developer_extras_enabled_ = false; | 111 bool TestShell::developer_extras_enabled_ = false; |
| 112 bool TestShell::layout_test_mode_ = false; | 112 bool TestShell::layout_test_mode_ = false; |
| 113 bool TestShell::allow_external_pages_ = false; | 113 bool TestShell::allow_external_pages_ = false; |
| 114 int TestShell::file_test_timeout_ms_ = kDefaultFileTestTimeoutMillisecs; | 114 int TestShell::file_test_timeout_ms_ = kDefaultFileTestTimeoutMillisecs; |
| 115 bool TestShell::test_is_preparing_ = false; | 115 bool TestShell::test_is_preparing_ = false; |
| 116 bool TestShell::test_is_pending_ = false; | 116 bool TestShell::test_is_pending_ = false; |
| 117 bool TestShell::accelerated_2d_canvas_enabled_ = false; | 117 bool TestShell::accelerated_2d_canvas_enabled_ = false; |
| 118 bool TestShell::accelerated_compositing_enabled_ = false; |
| 118 | 119 |
| 119 TestShell::TestShell() | 120 TestShell::TestShell() |
| 120 : m_mainWnd(NULL), | 121 : m_mainWnd(NULL), |
| 121 m_editWnd(NULL), | 122 m_editWnd(NULL), |
| 122 m_webViewHost(NULL), | 123 m_webViewHost(NULL), |
| 123 m_popupHost(NULL), | 124 m_popupHost(NULL), |
| 124 m_focusedWidgetHost(NULL), | 125 m_focusedWidgetHost(NULL), |
| 125 #if defined(OS_WIN) | 126 #if defined(OS_WIN) |
| 126 default_edit_wnd_proc_(0), | 127 default_edit_wnd_proc_(0), |
| 127 #endif | 128 #endif |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 if (web_prefs_) | 444 if (web_prefs_) |
| 444 web_prefs_->allow_scripts_to_close_windows = true; | 445 web_prefs_->allow_scripts_to_close_windows = true; |
| 445 } | 446 } |
| 446 | 447 |
| 447 // static | 448 // static |
| 448 void TestShell::SetAccelerated2dCanvasEnabled(bool enabled) { | 449 void TestShell::SetAccelerated2dCanvasEnabled(bool enabled) { |
| 449 accelerated_2d_canvas_enabled_ = enabled; | 450 accelerated_2d_canvas_enabled_ = enabled; |
| 450 } | 451 } |
| 451 | 452 |
| 452 // static | 453 // static |
| 454 void TestShell::SetAcceleratedCompositingEnabled(bool enabled) { |
| 455 accelerated_compositing_enabled_ = enabled; |
| 456 } |
| 457 |
| 458 // static |
| 453 void TestShell::ResetWebPreferences() { | 459 void TestShell::ResetWebPreferences() { |
| 454 DCHECK(web_prefs_); | 460 DCHECK(web_prefs_); |
| 455 | 461 |
| 456 // Match the settings used by Mac DumpRenderTree, with the exception of | 462 // Match the settings used by Mac DumpRenderTree, with the exception of |
| 457 // fonts. | 463 // fonts. |
| 458 if (web_prefs_) { | 464 if (web_prefs_) { |
| 459 *web_prefs_ = WebPreferences(); | 465 *web_prefs_ = WebPreferences(); |
| 460 | 466 |
| 461 #if defined(OS_MACOSX) | 467 #if defined(OS_MACOSX) |
| 462 web_prefs_->serif_font_family = L"Times"; | 468 web_prefs_->serif_font_family = L"Times"; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 web_prefs_->remote_fonts_enabled = true; | 512 web_prefs_->remote_fonts_enabled = true; |
| 507 web_prefs_->local_storage_enabled = true; | 513 web_prefs_->local_storage_enabled = true; |
| 508 web_prefs_->application_cache_enabled = true; | 514 web_prefs_->application_cache_enabled = true; |
| 509 web_prefs_->databases_enabled = true; | 515 web_prefs_->databases_enabled = true; |
| 510 web_prefs_->allow_file_access_from_file_urls = true; | 516 web_prefs_->allow_file_access_from_file_urls = true; |
| 511 // LayoutTests were written with Safari Mac in mind which does not allow | 517 // LayoutTests were written with Safari Mac in mind which does not allow |
| 512 // tabbing to links by default. | 518 // tabbing to links by default. |
| 513 web_prefs_->tabs_to_links = false; | 519 web_prefs_->tabs_to_links = false; |
| 514 web_prefs_->accelerated_2d_canvas_enabled = | 520 web_prefs_->accelerated_2d_canvas_enabled = |
| 515 accelerated_2d_canvas_enabled_; | 521 accelerated_2d_canvas_enabled_; |
| 516 | 522 web_prefs_->accelerated_compositing_enabled = |
| 523 accelerated_compositing_enabled_; |
| 517 // Allow those layout tests running as local files, i.e. under | 524 // Allow those layout tests running as local files, i.e. under |
| 518 // LayoutTests/http/tests/local, to access http server. | 525 // LayoutTests/http/tests/local, to access http server. |
| 519 if (layout_test_mode_) | 526 if (layout_test_mode_) |
| 520 web_prefs_->allow_universal_access_from_file_urls = true; | 527 web_prefs_->allow_universal_access_from_file_urls = true; |
| 521 } | 528 } |
| 522 } | 529 } |
| 523 | 530 |
| 524 // static | 531 // static |
| 525 bool TestShell::RemoveWindowFromList(gfx::NativeWindow window) { | 532 bool TestShell::RemoveWindowFromList(gfx::NativeWindow window) { |
| 526 WindowList::iterator entry = | 533 WindowList::iterator entry = |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 return -1; | 852 return -1; |
| 846 } | 853 } |
| 847 | 854 |
| 848 bool GetFontTable(int fd, uint32_t table, uint8_t* output, | 855 bool GetFontTable(int fd, uint32_t table, uint8_t* output, |
| 849 size_t* output_length) { | 856 size_t* output_length) { |
| 850 return false; | 857 return false; |
| 851 } | 858 } |
| 852 #endif | 859 #endif |
| 853 | 860 |
| 854 } // namespace webkit_glue | 861 } // namespace webkit_glue |
| OLD | NEW |