Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/string_util.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" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 const int kActionDelayMs = 500; | 49 const int kActionDelayMs = 500; |
| 50 | 50 |
| 51 const char kConsoleTestPage[] = "files/devtools/console_test_page.html"; | 51 const char kConsoleTestPage[] = "files/devtools/console_test_page.html"; |
| 52 const char kDebuggerTestPage[] = "files/devtools/debugger_test_page.html"; | 52 const char kDebuggerTestPage[] = "files/devtools/debugger_test_page.html"; |
| 53 const char kJsPage[] = "files/devtools/js_page.html"; | 53 const char kJsPage[] = "files/devtools/js_page.html"; |
| 54 const char kHeapProfilerPage[] = "files/devtools/heap_profiler.html"; | 54 const char kHeapProfilerPage[] = "files/devtools/heap_profiler.html"; |
| 55 const char kPauseWhenLoadingDevTools[] = | 55 const char kPauseWhenLoadingDevTools[] = |
| 56 "files/devtools/pause_when_loading_devtools.html"; | 56 "files/devtools/pause_when_loading_devtools.html"; |
| 57 const char kPauseWhenScriptIsRunning[] = | 57 const char kPauseWhenScriptIsRunning[] = |
| 58 "files/devtools/pause_when_script_is_running.html"; | 58 "files/devtools/pause_when_script_is_running.html"; |
| 59 const char kResourceContentLengthTestPage[] = "files/devtools/image.html"; | |
|
yurys
2011/01/19 09:13:26
Please remove the file as well.
| |
| 60 const char kResourceTestPage[] = "files/devtools/resource_test_page.html"; | 59 const char kResourceTestPage[] = "files/devtools/resource_test_page.html"; |
| 61 const char kSimplePage[] = "files/devtools/simple_page.html"; | 60 const char kSimplePage[] = "files/devtools/simple_page.html"; |
| 62 const char kCompletionOnPause[] = | 61 const char kCompletionOnPause[] = |
| 63 "files/devtools/completion_on_pause.html"; | 62 "files/devtools/completion_on_pause.html"; |
| 64 const char kPageWithContentScript[] = | 63 const char kPageWithContentScript[] = |
| 65 "files/devtools/page_with_content_script.html"; | 64 "files/devtools/page_with_content_script.html"; |
| 66 | 65 |
| 67 | 66 |
| 68 class DevToolsSanityTest : public InProcessBrowserTest { | 67 class DevToolsSanityTest : public InProcessBrowserTest { |
| 69 public: | 68 public: |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 break; | 245 break; |
| 247 default: | 246 default: |
| 248 NOTREACHED(); | 247 NOTREACHED(); |
| 249 break; | 248 break; |
| 250 } | 249 } |
| 251 } | 250 } |
| 252 | 251 |
| 253 FilePath test_extensions_dir_; | 252 FilePath test_extensions_dir_; |
| 254 }; | 253 }; |
| 255 | 254 |
| 256 // Fails after WebKit roll 69808:70011, http://crbug.com/59727. | |
| 257 #if defined(OS_LINUX) || defined(OS_WIN) | |
| 258 #define MAYBE_TestEnableResourcesTab DISABLED_TestEnableResourcesTab | |
| 259 #else | |
| 260 #define MAYBE_TestEnableResourcesTab TestEnableResourcesTab | |
| 261 #endif // defined(OS_LINUX) || defined(OS_WIN) | |
| 262 | |
| 263 // Tests resources panel enabling. | |
| 264 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, MAYBE_TestEnableResourcesTab) { | |
| 265 RunTest("testEnableResourcesTab", kSimplePage); | |
| 266 } | |
| 267 | |
| 268 // Fails after WebKit roll 59365:59477, http://crbug.com/44202. | |
| 269 #if defined(OS_LINUX) | |
| 270 #define MAYBE_TestResourceContentLength FLAKY_TestResourceContentLength | |
| 271 #else | |
| 272 #define MAYBE_TestResourceContentLength TestResourceContentLength | |
| 273 #endif // defined(OS_LINUX) | |
| 274 | |
| 275 // Tests profiler panel. | 255 // Tests profiler panel. |
| 276 // Disabled, http://crbug.com/68447. | 256 // Disabled, http://crbug.com/68447. |
| 277 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestProfilerTab) { | 257 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestProfilerTab) { |
| 278 RunTest("testProfilerTab", kJsPage); | 258 RunTest("testProfilerTab", kJsPage); |
| 279 } | 259 } |
| 280 | 260 |
| 281 // Tests heap profiler. | 261 // Tests heap profiler. |
| 282 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestHeapProfiler) { | 262 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestHeapProfiler) { |
| 283 RunTest("testHeapProfiler", kHeapProfilerPage); | 263 RunTest("testHeapProfiler", kHeapProfilerPage); |
| 284 } | 264 } |
| 285 | 265 |
| 286 // Tests scripts panel showing. | 266 // Tests scripts panel showing. |
| 287 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestShowScriptsTab) { | 267 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestShowScriptsTab) { |
| 288 RunTest("testShowScriptsTab", kDebuggerTestPage); | 268 RunTest("testShowScriptsTab", kDebuggerTestPage); |
| 289 } | 269 } |
| 290 | 270 |
| 291 // Fails after WebKit roll 75765:75812 (likely 75791), http://crbug.com/69719 | |
| 292 #if defined(OS_LINUX) || defined(OS_WIN) | |
| 293 #define MAYBE_TestScriptsTabIsPopulatedOnInspectedPageRefresh \ | |
| 294 FAILS_TestScriptsTabIsPopulatedOnInspectedPageRefresh | |
| 295 #else | |
| 296 #define MAYBE_TestScriptsTabIsPopulatedOnInspectedPageRefresh \ | |
| 297 TestScriptsTabIsPopulatedOnInspectedPageRefresh | |
| 298 #endif // defined(OS_LINUX) || defined(OS_WIN) | |
| 299 // Tests that scripts tab is populated with inspected scripts even if it | 271 // Tests that scripts tab is populated with inspected scripts even if it |
| 300 // hadn't been shown by the moment inspected paged refreshed. | 272 // hadn't been shown by the moment inspected paged refreshed. |
| 301 // @see http://crbug.com/26312 | 273 // @see http://crbug.com/26312 |
| 302 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, | 274 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, |
| 303 MAYBE_TestScriptsTabIsPopulatedOnInspectedPageRefresh) { | 275 TestScriptsTabIsPopulatedOnInspectedPageRefresh) { |
| 304 // Clear inspector settings to ensure that Elements will be | 276 // Clear inspector settings to ensure that Elements will be |
| 305 // current panel when DevTools window is open. | 277 // current panel when DevTools window is open. |
| 306 GetInspectedTab()->render_view_host()->delegate()->ClearInspectorSettings(); | 278 GetInspectedTab()->render_view_host()->delegate()->ClearInspectorSettings(); |
| 307 RunTest("testScriptsTabIsPopulatedOnInspectedPageRefresh", | 279 RunTest("testScriptsTabIsPopulatedOnInspectedPageRefresh", |
| 308 kDebuggerTestPage); | 280 kDebuggerTestPage); |
| 309 } | 281 } |
| 310 | 282 |
| 311 // Tests that a content script is in the scripts list. | 283 // Tests that a content script is in the scripts list. |
| 312 // This test is disabled, see bug 28961. | 284 // This test is disabled, see bug 28961. |
| 313 IN_PROC_BROWSER_TEST_F(DevToolsExtensionDebugTest, | 285 IN_PROC_BROWSER_TEST_F(DevToolsExtensionDebugTest, |
| 314 TestContentScriptIsPresent) { | 286 TestContentScriptIsPresent) { |
| 315 LoadExtension("simple_content_script"); | 287 LoadExtension("simple_content_script"); |
| 316 RunTest("testContentScriptIsPresent", kPageWithContentScript); | 288 RunTest("testContentScriptIsPresent", kPageWithContentScript); |
| 317 } | 289 } |
| 318 | 290 |
| 319 // Tests that scripts are not duplicated after Scripts Panel switch. | 291 // Tests that scripts are not duplicated after Scripts Panel switch. |
| 320 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, | 292 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, |
| 321 TestNoScriptDuplicatesOnPanelSwitch) { | 293 TestNoScriptDuplicatesOnPanelSwitch) { |
| 322 RunTest("testNoScriptDuplicatesOnPanelSwitch", kDebuggerTestPage); | 294 RunTest("testNoScriptDuplicatesOnPanelSwitch", kDebuggerTestPage); |
| 323 } | 295 } |
| 324 | 296 |
| 325 // Fails after WebKit roll 75765:75812 (likely 75791), http://crbug.com/69719 | |
| 326 #if defined(OS_LINUX) || defined(OS_WIN) | |
| 327 #define MAYBE_TestPauseWhenLoadingDevTools FAILS_TestPauseWhenLoadingDevTools | |
| 328 #else | |
| 329 #define MAYBE_TestPauseWhenLoadingDevTools TestPauseWhenLoadingDevTools | |
| 330 #endif // defined(OS_LINUX) || defined(OS_WIN) | |
| 331 // Tests that debugger works correctly if pause event occurs when DevTools | 297 // Tests that debugger works correctly if pause event occurs when DevTools |
| 332 // frontend is being loaded. | 298 // frontend is being loaded. |
| 333 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, MAYBE_TestPauseWhenLoadingDevTools) { | 299 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPauseWhenLoadingDevTools) { |
| 334 RunTest("testPauseWhenLoadingDevTools", kPauseWhenLoadingDevTools); | 300 RunTest("testPauseWhenLoadingDevTools", kPauseWhenLoadingDevTools); |
| 335 } | 301 } |
| 336 | 302 |
| 337 // Fails after WebKit roll 75765:75812 (likely 75791), http://crbug.com/69719 | |
| 338 #if defined(OS_LINUX) || defined(OS_WIN) | |
| 339 #define MAYBE_TestPauseWhenScriptIsRunning FAILS_TestPauseWhenScriptIsRunning | |
| 340 #else | |
| 341 #define MAYBE_TestPauseWhenScriptIsRunning TestPauseWhenScriptIsRunning | |
| 342 #endif // defined(OS_LINUX) || defined(OS_WIN) | |
| 343 // Tests that pressing 'Pause' will pause script execution if the script | 303 // Tests that pressing 'Pause' will pause script execution if the script |
| 344 // is already running. | 304 // is already running. |
| 345 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, MAYBE_TestPauseWhenScriptIsRunning) { | 305 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPauseWhenScriptIsRunning) { |
| 346 RunTest("testPauseWhenScriptIsRunning", kPauseWhenScriptIsRunning); | 306 RunTest("testPauseWhenScriptIsRunning", kPauseWhenScriptIsRunning); |
| 347 } | 307 } |
| 348 | 308 |
| 349 // Fails after WebKit roll 66724:66804, http://crbug.com/54592 | |
| 350 #if defined(OS_LINUX) || defined(OS_WIN) | |
| 351 #define MAYBE_TestCompletionOnPause FAILS_TestCompletionOnPause | |
| 352 #else | |
| 353 #define MAYBE_TestCompletionOnPause TestCompletionOnPause | |
| 354 #endif // defined(OS_LINUX) || defined(OS_WIN) | |
| 355 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, MAYBE_TestCompletionOnPause) { | |
| 356 RunTest("testCompletionOnPause", kCompletionOnPause); | |
| 357 } | |
| 358 | |
| 359 // Tests that 'Pause' button works for eval. | |
| 360 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestPauseInEval) { | |
| 361 RunTest("testPauseInEval", kDebuggerTestPage); | |
| 362 } | |
| 363 | |
| 364 } // namespace | 309 } // namespace |
| OLD | NEW |