OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/string_util.h" | 7 #include "base/stringprintf.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/debugger/devtools_client_host.h" | 9 #include "chrome/browser/debugger/devtools_client_host.h" |
10 #include "chrome/browser/debugger/devtools_manager.h" | 10 #include "chrome/browser/debugger/devtools_manager.h" |
11 #include "chrome/browser/debugger/devtools_window.h" | 11 #include "chrome/browser/debugger/devtools_window.h" |
12 #include "chrome/browser/extensions/extension_host.h" | 12 #include "chrome/browser/extensions/extension_host.h" |
13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
17 #include "chrome/test/in_process_browser_test.h" | 17 #include "chrome/test/in_process_browser_test.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 L"", | 78 L"", |
79 L"window.domAutomationController.send(" | 79 L"window.domAutomationController.send(" |
80 L"'' + (window.uiTests && (typeof uiTests.runTest)));", | 80 L"'' + (window.uiTests && (typeof uiTests.runTest)));", |
81 &result)); | 81 &result)); |
82 | 82 |
83 if (result == "function") { | 83 if (result == "function") { |
84 ASSERT_TRUE( | 84 ASSERT_TRUE( |
85 ui_test_utils::ExecuteJavaScriptAndExtractString( | 85 ui_test_utils::ExecuteJavaScriptAndExtractString( |
86 client_contents_->render_view_host(), | 86 client_contents_->render_view_host(), |
87 L"", | 87 L"", |
88 UTF8ToWide(StringPrintf("uiTests.runTest('%s')", | 88 UTF8ToWide(base::StringPrintf("uiTests.runTest('%s')", |
89 test_name.c_str())), | 89 test_name.c_str())), |
90 &result)); | 90 &result)); |
91 EXPECT_EQ("[OK]", result); | 91 EXPECT_EQ("[OK]", result); |
92 } else { | 92 } else { |
93 FAIL() << "DevTools front-end is broken."; | 93 FAIL() << "DevTools front-end is broken."; |
94 } | 94 } |
95 CloseDevToolsWindow(); | 95 CloseDevToolsWindow(); |
96 } | 96 } |
97 | 97 |
98 void OpenDevToolsWindow(const std::string& test_page) { | 98 void OpenDevToolsWindow(const std::string& test_page) { |
99 ASSERT_TRUE(test_server()->Start()); | 99 ASSERT_TRUE(test_server()->Start()); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 RunTest("testPauseWhenLoadingDevTools", kPauseWhenLoadingDevTools); | 282 RunTest("testPauseWhenLoadingDevTools", kPauseWhenLoadingDevTools); |
283 } | 283 } |
284 | 284 |
285 // Tests that pressing 'Pause' will pause script execution if the script | 285 // Tests that pressing 'Pause' will pause script execution if the script |
286 // is already running. | 286 // is already running. |
287 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPauseWhenScriptIsRunning) { | 287 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPauseWhenScriptIsRunning) { |
288 RunTest("testPauseWhenScriptIsRunning", kPauseWhenScriptIsRunning); | 288 RunTest("testPauseWhenScriptIsRunning", kPauseWhenScriptIsRunning); |
289 } | 289 } |
290 | 290 |
291 } // namespace | 291 } // namespace |
OLD | NEW |