| 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/browser.h" | 6 #include "chrome/browser/browser.h" |
| 7 #include "chrome/browser/debugger/devtools_client_host.h" | 7 #include "chrome/browser/debugger/devtools_client_host.h" |
| 8 #include "chrome/browser/debugger/devtools_manager.h" | 8 #include "chrome/browser/debugger/devtools_manager.h" |
| 9 #include "chrome/browser/debugger/devtools_window.h" | 9 #include "chrome/browser/debugger/devtools_window.h" |
| 10 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 NotificationRegistrar registrar_; | 36 NotificationRegistrar registrar_; |
| 37 DISALLOW_COPY_AND_ASSIGN(BrowserClosedObserver); | 37 DISALLOW_COPY_AND_ASSIGN(BrowserClosedObserver); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // The delay waited in some cases where we don't have a notifications for an | 40 // The delay waited in some cases where we don't have a notifications for an |
| 41 // action we take. | 41 // action we take. |
| 42 const int kActionDelayMs = 500; | 42 const int kActionDelayMs = 500; |
| 43 | 43 |
| 44 const wchar_t kConsoleTestPage[] = L"files/devtools/console_test_page.html"; |
| 45 const wchar_t kDebuggerTestPage[] = L"files/devtools/debugger_test_page.html"; |
| 46 const wchar_t kEvalTestPage[] = L"files/devtools/eval_test_page.html"; |
| 47 const wchar_t kJsPage[] = L"files/devtools/js_page.html"; |
| 44 const wchar_t kSimplePage[] = L"files/devtools/simple_page.html"; | 48 const wchar_t kSimplePage[] = L"files/devtools/simple_page.html"; |
| 45 const wchar_t kJsPage[] = L"files/devtools/js_page.html"; | |
| 46 const wchar_t kDebuggerTestPage[] = L"files/devtools/debugger_test_page.html"; | |
| 47 const wchar_t kConsoleTestPage[] = L"files/devtools/console_test_page.html"; | |
| 48 | 49 |
| 49 class DevToolsSanityTest : public InProcessBrowserTest { | 50 class DevToolsSanityTest : public InProcessBrowserTest { |
| 50 public: | 51 public: |
| 51 DevToolsSanityTest() { | 52 DevToolsSanityTest() { |
| 52 set_show_window(true); | 53 set_show_window(true); |
| 53 EnableDOMAutomation(); | 54 EnableDOMAutomation(); |
| 54 } | 55 } |
| 55 | 56 |
| 56 protected: | 57 protected: |
| 57 void RunTest(const std::string& test_name, const std::wstring& test_page) { | 58 void RunTest(const std::string& test_name, const std::wstring& test_page) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // Tests main resource load. | 129 // Tests main resource load. |
| 129 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestMainResource) { | 130 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestMainResource) { |
| 130 RunTest("testMainResource", kSimplePage); | 131 RunTest("testMainResource", kSimplePage); |
| 131 } | 132 } |
| 132 | 133 |
| 133 // Tests resources panel enabling. | 134 // Tests resources panel enabling. |
| 134 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestEnableResourcesTab) { | 135 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestEnableResourcesTab) { |
| 135 RunTest("testEnableResourcesTab", kSimplePage); | 136 RunTest("testEnableResourcesTab", kSimplePage); |
| 136 } | 137 } |
| 137 | 138 |
| 139 // Tests resource headers. |
| 140 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestResourceHeaders) { |
| 141 RunTest("testResourceHeaders", kDebuggerTestPage); |
| 142 } |
| 143 |
| 138 // Tests profiler panel. | 144 // Tests profiler panel. |
| 139 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestProfilerTab) { | 145 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestProfilerTab) { |
| 140 RunTest("testProfilerTab", kJsPage); | 146 RunTest("testProfilerTab", kJsPage); |
| 141 } | 147 } |
| 142 | 148 |
| 143 // Tests scripts panel showing. | 149 // Tests scripts panel showing. |
| 144 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestShowScriptsTab) { | 150 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestShowScriptsTab) { |
| 145 RunTest("testShowScriptsTab", kDebuggerTestPage); | 151 RunTest("testShowScriptsTab", kDebuggerTestPage); |
| 146 } | 152 } |
| 147 | 153 |
| 148 // Tests console eval. | 154 // Tests console eval. |
| 149 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestConsoleEval) { | 155 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestConsoleEval) { |
| 150 RunTest("testConsoleEval", kConsoleTestPage); | 156 RunTest("testConsoleEval", kConsoleTestPage); |
| 151 } | 157 } |
| 152 | 158 |
| 153 // Tests console log. | 159 // Tests console log. |
| 154 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestConsoleLog) { | 160 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestConsoleLog) { |
| 155 RunTest("testConsoleLog", kConsoleTestPage); | 161 RunTest("testConsoleLog", kConsoleTestPage); |
| 156 } | 162 } |
| 157 | 163 |
| 164 // Tests eval global values. |
| 165 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestEvalGlobal) { |
| 166 RunTest("testEvalGlobal", kEvalTestPage); |
| 167 } |
| 168 |
| 169 // Tests eval on call frame. |
| 170 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestEvalCallFrame) { |
| 171 RunTest("testEvalCallFrame", kEvalTestPage); |
| 172 } |
| 173 |
| 158 } // namespace | 174 } // namespace |
| OLD | NEW |