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 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2359 // but won't complete synchronously. | 2359 // but won't complete synchronously. |
2360 CommonNavigationParams common_params; | 2360 CommonNavigationParams common_params; |
2361 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 2361 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
2362 common_params.url = GURL("data:text/html,test data"); | 2362 common_params.url = GURL("data:text/html,test data"); |
2363 TestRenderFrame* main_frame = static_cast<TestRenderFrame*>(frame()); | 2363 TestRenderFrame* main_frame = static_cast<TestRenderFrame*>(frame()); |
2364 main_frame->Navigate(common_params, StartNavigationParams(), | 2364 main_frame->Navigate(common_params, StartNavigationParams(), |
2365 RequestNavigationParams()); | 2365 RequestNavigationParams()); |
2366 | 2366 |
2367 // Emulate a 4xx/5xx main resource response with an empty body. | 2367 // Emulate a 4xx/5xx main resource response with an empty body. |
2368 main_frame->didReceiveResponse(1, response); | 2368 main_frame->didReceiveResponse(1, response); |
2369 main_frame->didFinishDocumentLoad(web_frame, true); | 2369 main_frame->didFinishDocumentLoad(web_frame); |
| 2370 main_frame->runScriptsAtDocumentReady(web_frame, true); |
2370 | 2371 |
2371 // The error page itself is loaded asynchronously. | 2372 // The error page itself is loaded asynchronously. |
2372 FrameLoadWaiter(main_frame).Wait(); | 2373 FrameLoadWaiter(main_frame).Wait(); |
2373 const int kMaxOutputCharacters = 22; | 2374 const int kMaxOutputCharacters = 22; |
2374 EXPECT_EQ("A suffusion of yellow.", | 2375 EXPECT_EQ("A suffusion of yellow.", |
2375 base::UTF16ToASCII( | 2376 base::UTF16ToASCII( |
2376 base::StringPiece16(WebFrameContentDumper::dumpFrameTreeAsText( | 2377 base::StringPiece16(WebFrameContentDumper::dumpFrameTreeAsText( |
2377 web_frame, kMaxOutputCharacters)))); | 2378 web_frame, kMaxOutputCharacters)))); |
2378 } | 2379 } |
2379 | 2380 |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2855 FROM_HERE, | 2856 FROM_HERE, |
2856 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); | 2857 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); |
2857 ExecuteJavaScriptForTests("debugger;"); | 2858 ExecuteJavaScriptForTests("debugger;"); |
2858 | 2859 |
2859 // CloseWhilePaused should resume execution and continue here. | 2860 // CloseWhilePaused should resume execution and continue here. |
2860 EXPECT_FALSE(IsPaused()); | 2861 EXPECT_FALSE(IsPaused()); |
2861 Detach(); | 2862 Detach(); |
2862 } | 2863 } |
2863 | 2864 |
2864 } // namespace content | 2865 } // namespace content |
OLD | NEW |