| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <tuple> | 7 #include <tuple> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 2480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2491 } | 2491 } |
| 2492 | 2492 |
| 2493 #endif | 2493 #endif |
| 2494 | 2494 |
| 2495 TEST_F(DevToolsAgentTest, DevToolsResumeOnClose) { | 2495 TEST_F(DevToolsAgentTest, DevToolsResumeOnClose) { |
| 2496 Attach(); | 2496 Attach(); |
| 2497 EXPECT_FALSE(IsPaused()); | 2497 EXPECT_FALSE(IsPaused()); |
| 2498 DispatchDevToolsMessage("Debugger.enable", | 2498 DispatchDevToolsMessage("Debugger.enable", |
| 2499 "{\"id\":1,\"method\":\"Debugger.enable\"}"); | 2499 "{\"id\":1,\"method\":\"Debugger.enable\"}"); |
| 2500 | 2500 |
| 2501 // Executing javascript will pause the thread and create nested message loop. | 2501 // Executing javascript will pause the thread and create nested run loop. |
| 2502 // Posting task simulates message coming from browser. | 2502 // Posting task simulates message coming from browser. |
| 2503 base::ThreadTaskRunnerHandle::Get()->PostTask( | 2503 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 2504 FROM_HERE, | 2504 FROM_HERE, |
| 2505 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); | 2505 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); |
| 2506 ExecuteJavaScriptForTests("debugger;"); | 2506 ExecuteJavaScriptForTests("debugger;"); |
| 2507 | 2507 |
| 2508 // CloseWhilePaused should resume execution and continue here. | 2508 // CloseWhilePaused should resume execution and continue here. |
| 2509 EXPECT_FALSE(IsPaused()); | 2509 EXPECT_FALSE(IsPaused()); |
| 2510 Detach(); | 2510 Detach(); |
| 2511 } | 2511 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2590 ExpectPauseAndResume(3); | 2590 ExpectPauseAndResume(3); |
| 2591 blink::WebScriptSource source2( | 2591 blink::WebScriptSource source2( |
| 2592 WebString::FromUTF8("function func2() { func1(); }; func2();")); | 2592 WebString::FromUTF8("function func2() { func1(); }; func2();")); |
| 2593 frame()->GetWebFrame()->ExecuteScriptInIsolatedWorld(17, &source2, 1); | 2593 frame()->GetWebFrame()->ExecuteScriptInIsolatedWorld(17, &source2, 1); |
| 2594 | 2594 |
| 2595 EXPECT_FALSE(IsPaused()); | 2595 EXPECT_FALSE(IsPaused()); |
| 2596 Detach(); | 2596 Detach(); |
| 2597 } | 2597 } |
| 2598 | 2598 |
| 2599 } // namespace content | 2599 } // namespace content |
| OLD | NEW |