| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "web/tests/FrameTestHelpers.h" | 31 #include "web/tests/FrameTestHelpers.h" |
| 32 | 32 |
| 33 #include "platform/testing/URLTestHelpers.h" | 33 #include "platform/testing/URLTestHelpers.h" |
| 34 #include "platform/testing/UnitTestHelpers.h" | 34 #include "platform/testing/UnitTestHelpers.h" |
| 35 #include "platform/testing/WebLayerTreeViewImplForTesting.h" | 35 #include "platform/testing/WebLayerTreeViewImplForTesting.h" |
| 36 #include "public/platform/Platform.h" | 36 #include "public/platform/Platform.h" |
| 37 #include "public/platform/WebData.h" | 37 #include "public/platform/WebData.h" |
| 38 #include "public/platform/WebString.h" | 38 #include "public/platform/WebString.h" |
| 39 #include "public/platform/WebThread.h" | 39 #include "public/platform/WebThread.h" |
| 40 #include "public/platform/WebURLLoaderMockFactory.h" |
| 40 #include "public/platform/WebURLRequest.h" | 41 #include "public/platform/WebURLRequest.h" |
| 41 #include "public/platform/WebURLResponse.h" | 42 #include "public/platform/WebURLResponse.h" |
| 42 #include "public/platform/WebUnitTestSupport.h" | |
| 43 #include "public/web/WebFrameWidget.h" | 43 #include "public/web/WebFrameWidget.h" |
| 44 #include "public/web/WebRemoteFrame.h" | 44 #include "public/web/WebRemoteFrame.h" |
| 45 #include "public/web/WebSettings.h" | 45 #include "public/web/WebSettings.h" |
| 46 #include "public/web/WebTreeScopeType.h" | 46 #include "public/web/WebTreeScopeType.h" |
| 47 #include "public/web/WebViewClient.h" | 47 #include "public/web/WebViewClient.h" |
| 48 #include "web/WebLocalFrameImpl.h" | 48 #include "web/WebLocalFrameImpl.h" |
| 49 #include "web/WebRemoteFrameImpl.h" | 49 #include "web/WebRemoteFrameImpl.h" |
| 50 #include "wtf/Functional.h" | 50 #include "wtf/Functional.h" |
| 51 #include "wtf/StdLibExtras.h" | 51 #include "wtf/StdLibExtras.h" |
| 52 #include "wtf/text/StringBuilder.h" | 52 #include "wtf/text/StringBuilder.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 71 // 6. When runServeAsyncRequestsTask() notices there are no more loads in | 71 // 6. When runServeAsyncRequestsTask() notices there are no more loads in |
| 72 // progress, it exits the run loop. | 72 // progress, it exits the run loop. |
| 73 // 7. At this point, all parsing, resource loads, and layout should be finished. | 73 // 7. At this point, all parsing, resource loads, and layout should be finished. |
| 74 TestWebFrameClient* testClientForFrame(WebFrame* frame) | 74 TestWebFrameClient* testClientForFrame(WebFrame* frame) |
| 75 { | 75 { |
| 76 return static_cast<TestWebFrameClient*>(toWebLocalFrameImpl(frame)->client()
); | 76 return static_cast<TestWebFrameClient*>(toWebLocalFrameImpl(frame)->client()
); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void runServeAsyncRequestsTask(TestWebFrameClient* client) | 79 void runServeAsyncRequestsTask(TestWebFrameClient* client) |
| 80 { | 80 { |
| 81 Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests(); | 81 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); |
| 82 if (client->isLoading()) | 82 if (client->isLoading()) |
| 83 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK
_FROM_HERE, bind(&runServeAsyncRequestsTask, client)); | 83 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK
_FROM_HERE, bind(&runServeAsyncRequestsTask, client)); |
| 84 else | 84 else |
| 85 testing::exitRunLoop(); | 85 testing::exitRunLoop(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 TestWebFrameClient* defaultWebFrameClient() | 88 TestWebFrameClient* defaultWebFrameClient() |
| 89 { | 89 { |
| 90 DEFINE_STATIC_LOCAL(TestWebFrameClient, client, ()); | 90 DEFINE_STATIC_LOCAL(TestWebFrameClient, client, ()); |
| 91 return &client; | 91 return &client; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 m_frame->close(); | 301 m_frame->close(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 void TestWebViewClient::initializeLayerTreeView() | 304 void TestWebViewClient::initializeLayerTreeView() |
| 305 { | 305 { |
| 306 m_layerTreeView = adoptPtr(new WebLayerTreeViewImplForTesting); | 306 m_layerTreeView = adoptPtr(new WebLayerTreeViewImplForTesting); |
| 307 } | 307 } |
| 308 | 308 |
| 309 } // namespace FrameTestHelpers | 309 } // namespace FrameTestHelpers |
| 310 } // namespace blink | 310 } // namespace blink |
| OLD | NEW |