| 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 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1854 // but won't complete synchronously. | 1854 // but won't complete synchronously. |
| 1855 CommonNavigationParams common_params; | 1855 CommonNavigationParams common_params; |
| 1856 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 1856 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
| 1857 common_params.url = GURL("data:text/html,test data"); | 1857 common_params.url = GURL("data:text/html,test data"); |
| 1858 TestRenderFrame* main_frame = static_cast<TestRenderFrame*>(frame()); | 1858 TestRenderFrame* main_frame = static_cast<TestRenderFrame*>(frame()); |
| 1859 main_frame->Navigate(common_params, StartNavigationParams(), | 1859 main_frame->Navigate(common_params, StartNavigationParams(), |
| 1860 RequestNavigationParams()); | 1860 RequestNavigationParams()); |
| 1861 | 1861 |
| 1862 // Emulate a 4xx/5xx main resource response with an empty body. | 1862 // Emulate a 4xx/5xx main resource response with an empty body. |
| 1863 main_frame->didReceiveResponse(1, response); | 1863 main_frame->didReceiveResponse(1, response); |
| 1864 main_frame->didFinishDocumentLoad(web_frame, true); | 1864 main_frame->didFinishDocumentLoad(web_frame); |
| 1865 main_frame->runScriptsAtDocumentReady(web_frame, true); |
| 1865 | 1866 |
| 1866 // The error page itself is loaded asynchronously. | 1867 // The error page itself is loaded asynchronously. |
| 1867 FrameLoadWaiter(main_frame).Wait(); | 1868 FrameLoadWaiter(main_frame).Wait(); |
| 1868 const int kMaxOutputCharacters = 22; | 1869 const int kMaxOutputCharacters = 22; |
| 1869 EXPECT_EQ("A suffusion of yellow.", | 1870 EXPECT_EQ("A suffusion of yellow.", |
| 1870 base::UTF16ToASCII( | 1871 base::UTF16ToASCII( |
| 1871 base::StringPiece16(WebFrameContentDumper::dumpFrameTreeAsText( | 1872 base::StringPiece16(WebFrameContentDumper::dumpFrameTreeAsText( |
| 1872 web_frame, kMaxOutputCharacters)))); | 1873 web_frame, kMaxOutputCharacters)))); |
| 1873 } | 1874 } |
| 1874 | 1875 |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 FROM_HERE, | 2355 FROM_HERE, |
| 2355 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); | 2356 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); |
| 2356 ExecuteJavaScriptForTests("debugger;"); | 2357 ExecuteJavaScriptForTests("debugger;"); |
| 2357 | 2358 |
| 2358 // CloseWhilePaused should resume execution and continue here. | 2359 // CloseWhilePaused should resume execution and continue here. |
| 2359 EXPECT_FALSE(IsPaused()); | 2360 EXPECT_FALSE(IsPaused()); |
| 2360 Detach(); | 2361 Detach(); |
| 2361 } | 2362 } |
| 2362 | 2363 |
| 2363 } // namespace content | 2364 } // namespace content |
| OLD | NEW |