OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/cancelable_callback.h" | 6 #include "base/cancelable_callback.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 EXPECT_EQ("[OK]", result); | 115 EXPECT_EQ("[OK]", result); |
116 } else { | 116 } else { |
117 FAIL() << "DevTools front-end is broken."; | 117 FAIL() << "DevTools front-end is broken."; |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
121 class DevToolsSanityTest : public InProcessBrowserTest { | 121 class DevToolsSanityTest : public InProcessBrowserTest { |
122 public: | 122 public: |
123 DevToolsSanityTest() | 123 DevToolsSanityTest() |
124 : window_(NULL), | 124 : window_(NULL), |
125 inspected_rvh_(NULL) { | 125 inspected_rvh_(NULL) {} |
126 EnableDOMAutomation(); | |
127 } | |
128 | 126 |
129 protected: | 127 protected: |
130 void RunTest(const std::string& test_name, const std::string& test_page) { | 128 void RunTest(const std::string& test_name, const std::string& test_page) { |
131 OpenDevToolsWindow(test_page); | 129 OpenDevToolsWindow(test_page); |
132 RunTestFunction(window_, test_name.c_str()); | 130 RunTestFunction(window_, test_name.c_str()); |
133 CloseDevToolsWindow(); | 131 CloseDevToolsWindow(); |
134 } | 132 } |
135 | 133 |
136 void OpenDevToolsWindow(const std::string& test_page) { | 134 void OpenDevToolsWindow(const std::string& test_page) { |
137 ASSERT_TRUE(test_server()->Start()); | 135 ASSERT_TRUE(test_server()->Start()); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 261 |
264 class DevToolsExperimentalExtensionTest : public DevToolsExtensionTest { | 262 class DevToolsExperimentalExtensionTest : public DevToolsExtensionTest { |
265 public: | 263 public: |
266 void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 264 void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
267 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 265 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
268 } | 266 } |
269 }; | 267 }; |
270 | 268 |
271 class WorkerDevToolsSanityTest : public InProcessBrowserTest { | 269 class WorkerDevToolsSanityTest : public InProcessBrowserTest { |
272 public: | 270 public: |
273 WorkerDevToolsSanityTest() : window_(NULL) { | 271 WorkerDevToolsSanityTest() : window_(NULL) {} |
274 EnableDOMAutomation(); | |
275 } | |
276 | 272 |
277 protected: | 273 protected: |
278 class WorkerData : public base::RefCountedThreadSafe<WorkerData> { | 274 class WorkerData : public base::RefCountedThreadSafe<WorkerData> { |
279 public: | 275 public: |
280 WorkerData() : worker_process_id(0), worker_route_id(0) {} | 276 WorkerData() : worker_process_id(0), worker_route_id(0) {} |
281 int worker_process_id; | 277 int worker_process_id; |
282 int worker_route_id; | 278 int worker_route_id; |
283 | 279 |
284 private: | 280 private: |
285 friend class base::RefCountedThreadSafe<WorkerData>; | 281 friend class base::RefCountedThreadSafe<WorkerData>; |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 content::CONSOLE_MESSAGE_LEVEL_LOG, | 602 content::CONSOLE_MESSAGE_LEVEL_LOG, |
607 "log"); | 603 "log"); |
608 devtools_manager->AddMessageToConsole(agent_host, | 604 devtools_manager->AddMessageToConsole(agent_host, |
609 content::CONSOLE_MESSAGE_LEVEL_ERROR, | 605 content::CONSOLE_MESSAGE_LEVEL_ERROR, |
610 "error"); | 606 "error"); |
611 RunTestFunction(window_, "checkLogAndErrorMessages"); | 607 RunTestFunction(window_, "checkLogAndErrorMessages"); |
612 CloseDevToolsWindow(); | 608 CloseDevToolsWindow(); |
613 } | 609 } |
614 | 610 |
615 } // namespace | 611 } // namespace |
OLD | NEW |