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 // This file contains the definition for LayoutTestController. | 5 // This file contains the definition for LayoutTestController. |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "webkit/tools/test_shell/layout_test_controller.h" | 9 #include "webkit/tools/test_shell/layout_test_controller.h" |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 BindMethod("setCallCloseOnWebViews", &LayoutTestController::setCallCloseOnWebV
iews); | 140 BindMethod("setCallCloseOnWebViews", &LayoutTestController::setCallCloseOnWebV
iews); |
141 BindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrows
ingEnabled); | 141 BindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrows
ingEnabled); |
142 BindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDa
shboardCompatibilityMode); | 142 BindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDa
shboardCompatibilityMode); |
143 | 143 |
144 BindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled
); | 144 BindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled
); |
145 BindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScr
iptInIsolatedWorld); | 145 BindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScr
iptInIsolatedWorld); |
146 BindMethod("overridePreference", &LayoutTestController::overridePreference); | 146 BindMethod("overridePreference", &LayoutTestController::overridePreference); |
147 BindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAl
lowUniversalAccessFromFileURLs); | 147 BindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAl
lowUniversalAccessFromFileURLs); |
148 BindMethod("setTimelineProfilingEnabled", &LayoutTestController::setTimelinePr
ofilingEnabled); | 148 BindMethod("setTimelineProfilingEnabled", &LayoutTestController::setTimelinePr
ofilingEnabled); |
149 BindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspe
ctor); | 149 BindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspe
ctor); |
| 150 BindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelection
Colors); |
150 | 151 |
151 // The fallback method is called when an unknown method is invoked. | 152 // The fallback method is called when an unknown method is invoked. |
152 BindFallbackMethod(&LayoutTestController::fallbackMethod); | 153 BindFallbackMethod(&LayoutTestController::fallbackMethod); |
153 | 154 |
154 // Shared properties. | 155 // Shared properties. |
155 // globalFlag is used by a number of layout tests in | 156 // globalFlag is used by a number of layout tests in |
156 // LayoutTests\http\tests\security\dataURL. | 157 // LayoutTests\http\tests\security\dataURL. |
157 BindProperty("globalFlag", &globalFlag_); | 158 BindProperty("globalFlag", &globalFlag_); |
158 // webHistoryItemCount is used by tests in LayoutTests\http\tests\history | 159 // webHistoryItemCount is used by tests in LayoutTests\http\tests\history |
159 BindProperty("webHistoryItemCount", &webHistoryItemCount_); | 160 BindProperty("webHistoryItemCount", &webHistoryItemCount_); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 result->SetNull(); | 425 result->SetNull(); |
425 return; | 426 return; |
426 } | 427 } |
427 result->Set(args[0].isEqual(args[1])); | 428 result->Set(args[0].isEqual(args[1])); |
428 } | 429 } |
429 | 430 |
430 void LayoutTestController::Reset() { | 431 void LayoutTestController::Reset() { |
431 if (shell_) { | 432 if (shell_) { |
432 shell_->webView()->setZoomLevel(false, 0); | 433 shell_->webView()->setZoomLevel(false, 0); |
433 shell_->webView()->setTabKeyCyclesThroughElements(true); | 434 shell_->webView()->setTabKeyCyclesThroughElements(true); |
| 435 #if defined(OS_LINUX) |
| 436 // (Constants copied because we can't depend on the header that defined |
| 437 // them from this file.) |
| 438 // shell_->webView()->setSelectionColors( |
| 439 // 0xff1e90ff, 0xff000000, 0xffc8c8c8, 0xff323232); |
| 440 #endif // defined(OS_LINUX) |
434 } | 441 } |
435 dump_as_text_ = false; | 442 dump_as_text_ = false; |
436 dump_editing_callbacks_ = false; | 443 dump_editing_callbacks_ = false; |
437 dump_frame_load_callbacks_ = false; | 444 dump_frame_load_callbacks_ = false; |
438 dump_resource_load_callbacks_ = false; | 445 dump_resource_load_callbacks_ = false; |
439 dump_back_forward_list_ = false; | 446 dump_back_forward_list_ = false; |
440 dump_child_frame_scroll_positions_ = false; | 447 dump_child_frame_scroll_positions_ = false; |
441 dump_child_frames_as_text_ = false; | 448 dump_child_frames_as_text_ = false; |
442 dump_window_status_changes_ = false; | 449 dump_window_status_changes_ = false; |
443 dump_title_changes_ = false; | 450 dump_title_changes_ = false; |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 | 1055 |
1049 void LayoutTestController::evaluateInWebInspector(const CppArgumentList& args, | 1056 void LayoutTestController::evaluateInWebInspector(const CppArgumentList& args, |
1050 CppVariant* result) { | 1057 CppVariant* result) { |
1051 result->SetNull(); | 1058 result->SetNull(); |
1052 if (args.size() < 2 || !args[0].isInt32() || !args[1].isString()) | 1059 if (args.size() < 2 || !args[0].isInt32() || !args[1].isString()) |
1053 return; | 1060 return; |
1054 shell_->dev_tools_agent()->evaluateInWebInspector(args[0].ToInt32(), | 1061 shell_->dev_tools_agent()->evaluateInWebInspector(args[0].ToInt32(), |
1055 args[1].ToString()); | 1062 args[1].ToString()); |
1056 } | 1063 } |
1057 | 1064 |
| 1065 void LayoutTestController::forceRedSelectionColors(const CppArgumentList& args, |
| 1066 CppVariant* result) { |
| 1067 result->SetNull(); |
| 1068 shell_->webView()->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000, |
| 1069 0xffc0c0c0); |
| 1070 } |
OLD | NEW |