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" |
11 #include "chrome/browser/tab_contents/tab_contents.h" | 11 #include "chrome/browser/tab_contents/tab_contents.h" |
12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/common/notification_registrar.h" | 13 #include "chrome/common/notification_registrar.h" |
14 #include "chrome/common/notification_service.h" | 14 #include "chrome/common/notification_service.h" |
15 #include "chrome/test/in_process_browser_test.h" | 15 #include "chrome/test/in_process_browser_test.h" |
16 #include "chrome/test/ui_test_utils.h" | 16 #include "chrome/test/ui_test_utils.h" |
17 | 17 |
18 | 18 |
19 #if defined(OS_WIN) | |
20 #define MAYBE_TestShowScriptsTab DISABLED_TestShowScriptsTab | |
21 #define MAYBE_TestSetBreakpoint TestSetBreakpoint | |
22 #elif defined(OS_LINUX) | |
23 // http://crbug.com/19748 | |
24 #define MAYBE_TestShowScriptsTab DISABLED_TestShowScriptsTab | |
25 #define MAYBE_TestSetBreakpoint DISABLED_TestSetBreakpoint | |
26 #endif | |
27 | |
28 namespace { | 19 namespace { |
29 | 20 |
30 // Used to block until a dev tools client window's browser is closed. | 21 // Used to block until a dev tools client window's browser is closed. |
31 class BrowserClosedObserver : public NotificationObserver { | 22 class BrowserClosedObserver : public NotificationObserver { |
32 public: | 23 public: |
33 BrowserClosedObserver(Browser* browser) { | 24 BrowserClosedObserver(Browser* browser) { |
34 registrar_.Add(this, NotificationType::BROWSER_CLOSED, | 25 registrar_.Add(this, NotificationType::BROWSER_CLOSED, |
35 Source<Browser>(browser)); | 26 Source<Browser>(browser)); |
36 ui_test_utils::RunMessageLoop(); | 27 ui_test_utils::RunMessageLoop(); |
37 } | 28 } |
(...skipping 10 matching lines...) Expand all Loading... |
48 }; | 39 }; |
49 | 40 |
50 // The delay waited in some cases where we don't have a notifications for an | 41 // The delay waited in some cases where we don't have a notifications for an |
51 // action we take. | 42 // action we take. |
52 const int kActionDelayMs = 500; | 43 const int kActionDelayMs = 500; |
53 | 44 |
54 const wchar_t kConsoleTestPage[] = L"files/devtools/console_test_page.html"; | 45 const wchar_t kConsoleTestPage[] = L"files/devtools/console_test_page.html"; |
55 const wchar_t kDebuggerTestPage[] = L"files/devtools/debugger_test_page.html"; | 46 const wchar_t kDebuggerTestPage[] = L"files/devtools/debugger_test_page.html"; |
56 const wchar_t kEvalTestPage[] = L"files/devtools/eval_test_page.html"; | 47 const wchar_t kEvalTestPage[] = L"files/devtools/eval_test_page.html"; |
57 const wchar_t kJsPage[] = L"files/devtools/js_page.html"; | 48 const wchar_t kJsPage[] = L"files/devtools/js_page.html"; |
| 49 const wchar_t kResourceTestPage[] = L"files/devtools/resource_test_page.html"; |
58 const wchar_t kSimplePage[] = L"files/devtools/simple_page.html"; | 50 const wchar_t kSimplePage[] = L"files/devtools/simple_page.html"; |
59 | 51 |
60 class DevToolsSanityTest : public InProcessBrowserTest { | 52 class DevToolsSanityTest : public InProcessBrowserTest { |
61 public: | 53 public: |
62 DevToolsSanityTest() { | 54 DevToolsSanityTest() { |
63 set_show_window(true); | 55 set_show_window(true); |
64 EnableDOMAutomation(); | 56 EnableDOMAutomation(); |
65 } | 57 } |
66 | 58 |
67 protected: | 59 protected: |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 RunTest("testMainResource", kSimplePage); | 134 RunTest("testMainResource", kSimplePage); |
143 } | 135 } |
144 | 136 |
145 // Tests resources panel enabling. | 137 // Tests resources panel enabling. |
146 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestEnableResourcesTab) { | 138 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestEnableResourcesTab) { |
147 RunTest("testEnableResourcesTab", kSimplePage); | 139 RunTest("testEnableResourcesTab", kSimplePage); |
148 } | 140 } |
149 | 141 |
150 // Tests resource headers. | 142 // Tests resource headers. |
151 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestResourceHeaders) { | 143 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestResourceHeaders) { |
152 RunTest("testResourceHeaders", kDebuggerTestPage); | 144 RunTest("testResourceHeaders", kResourceTestPage); |
153 } | 145 } |
154 | 146 |
155 // Tests profiler panel. | 147 // Tests profiler panel. |
156 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestProfilerTab) { | 148 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestProfilerTab) { |
157 RunTest("testProfilerTab", kJsPage); | 149 RunTest("testProfilerTab", kJsPage); |
158 } | 150 } |
159 | 151 |
160 // Tests scripts panel showing. | 152 // Tests scripts panel showing. |
161 // http://crbug.com/16767 | 153 // http://crbug.com/16767 |
162 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, MAYBE_TestShowScriptsTab) { | 154 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestShowScriptsTab) { |
163 RunTest("testShowScriptsTab", kDebuggerTestPage); | 155 RunTest("testShowScriptsTab", kDebuggerTestPage); |
164 } | 156 } |
165 | 157 |
166 // Tests set breakpoint. | 158 // Tests set breakpoint. |
167 // http://crbug.com/16767 | 159 // http://crbug.com/16767 |
168 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, MAYBE_TestSetBreakpoint) { | 160 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestSetBreakpoint) { |
169 RunTest("testSetBreakpoint", kDebuggerTestPage); | 161 RunTest("testSetBreakpoint", kDebuggerTestPage); |
170 } | 162 } |
171 | 163 |
172 // Tests that 'Pause' button works for eval. | 164 // Tests that 'Pause' button works for eval. |
173 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestPauseInEval) { | 165 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestPauseInEval) { |
174 RunTest("testPauseInEval", kDebuggerTestPage); | 166 RunTest("testPauseInEval", kDebuggerTestPage); |
175 } | 167 } |
176 | 168 |
177 // Tests console eval. | 169 // Tests console eval. |
178 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestConsoleEval) { | 170 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestConsoleEval) { |
179 RunTest("testConsoleEval", kConsoleTestPage); | 171 RunTest("testConsoleEval", kConsoleTestPage); |
180 } | 172 } |
181 | 173 |
182 // Tests console log. | 174 // Tests console log. |
183 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestConsoleLog) { | 175 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestConsoleLog) { |
184 RunTest("testConsoleLog", kConsoleTestPage); | 176 RunTest("testConsoleLog", kConsoleTestPage); |
185 } | 177 } |
186 | 178 |
187 // Tests eval global values. | 179 // Tests eval global values. |
188 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestEvalGlobal) { | 180 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestEvalGlobal) { |
189 RunTest("testEvalGlobal", kEvalTestPage); | 181 RunTest("testEvalGlobal", kEvalTestPage); |
190 } | 182 } |
191 | 183 |
192 // Tests eval on call frame. | 184 // Tests eval on call frame. |
193 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestEvalCallFrame) { | 185 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestEvalCallFrame) { |
194 RunTest("testEvalCallFrame", kEvalTestPage); | 186 RunTest("testEvalCallFrame", kEvalTestPage); |
195 } | 187 } |
196 | 188 |
197 } // namespace | 189 } // namespace |
OLD | NEW |