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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 } | 331 } |
332 | 332 |
333 private: | 333 private: |
334 scoped_ptr<MockKeyboard> mock_keyboard_; | 334 scoped_ptr<MockKeyboard> mock_keyboard_; |
335 }; | 335 }; |
336 | 336 |
337 class DevToolsAgentTest : public RenderViewImplTest { | 337 class DevToolsAgentTest : public RenderViewImplTest { |
338 public: | 338 public: |
339 void Attach() { | 339 void Attach() { |
340 std::string host_id = "host_id"; | 340 std::string host_id = "host_id"; |
341 agent()->OnAttach(host_id); | 341 agent()->OnAttach(host_id, 17); |
342 } | 342 } |
343 | 343 |
344 void Detach() { | 344 void Detach() { |
345 agent()->OnDetach(); | 345 agent()->OnDetach(); |
346 } | 346 } |
347 | 347 |
348 bool IsPaused() { | 348 bool IsPaused() { |
349 return agent()->paused_; | 349 return agent()->paused_; |
350 } | 350 } |
351 | 351 |
352 void DispatchDevToolsMessage(const std::string& message) { | 352 void DispatchDevToolsMessage(const std::string& message) { |
353 agent()->OnDispatchOnInspectorBackend(message); | 353 agent()->OnDispatchOnInspectorBackend(17, message); |
354 } | 354 } |
355 | 355 |
356 void CloseWhilePaused() { | 356 void CloseWhilePaused() { |
357 EXPECT_TRUE(IsPaused()); | 357 EXPECT_TRUE(IsPaused()); |
358 view()->NotifyOnClose(); | 358 view()->NotifyOnClose(); |
359 } | 359 } |
360 | 360 |
361 private: | 361 private: |
362 DevToolsAgent* agent() { | 362 DevToolsAgent* agent() { |
363 return frame()->devtools_agent(); | 363 return frame()->devtools_agent(); |
(...skipping 2111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2475 FROM_HERE, | 2475 FROM_HERE, |
2476 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); | 2476 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); |
2477 ExecuteJavaScriptForTests("debugger;"); | 2477 ExecuteJavaScriptForTests("debugger;"); |
2478 | 2478 |
2479 // CloseWhilePaused should resume execution and continue here. | 2479 // CloseWhilePaused should resume execution and continue here. |
2480 EXPECT_FALSE(IsPaused()); | 2480 EXPECT_FALSE(IsPaused()); |
2481 Detach(); | 2481 Detach(); |
2482 } | 2482 } |
2483 | 2483 |
2484 } // namespace content | 2484 } // namespace content |
OLD | NEW |