Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(835)

Side by Side Diff: Source/web/tests/sim/SimRequest.cpp

Issue 1329553004: Add a FOUC painting test. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix build. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/sim/SimRequest.h ('k') | Source/web/web.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "config.h" 5 #include "config.h"
6 #include "web/tests/sim/SimRequest.h" 6 #include "web/tests/sim/SimRequest.h"
7 7
8 #include "platform/weborigin/KURL.h" 8 #include "platform/weborigin/KURL.h"
9 #include "public/platform/Platform.h" 9 #include "public/platform/Platform.h"
10 #include "public/platform/WebURLLoaderClient.h" 10 #include "public/platform/WebURLLoaderClient.h"
(...skipping 10 matching lines...) Expand all
21 , m_isReady(false) 21 , m_isReady(false)
22 { 22 {
23 KURL fullUrl(ParsedURLString, url); 23 KURL fullUrl(ParsedURLString, url);
24 WebURLResponse response(fullUrl); 24 WebURLResponse response(fullUrl);
25 response.setMIMEType(mimeType); 25 response.setMIMEType(mimeType);
26 response.setHTTPStatusCode(200); 26 response.setHTTPStatusCode(200);
27 Platform::current()->unitTestSupport()->registerMockedURL(fullUrl, response, ""); 27 Platform::current()->unitTestSupport()->registerMockedURL(fullUrl, response, "");
28 SimNetwork::current().addRequest(*this); 28 SimNetwork::current().addRequest(*this);
29 } 29 }
30 30
31 SimRequest::~SimRequest()
32 {
33 ASSERT(!m_isReady);
34 }
35
31 void SimRequest::didReceiveResponse(WebURLLoaderClient* client, WebURLLoader* lo ader, const WebURLResponse& response) 36 void SimRequest::didReceiveResponse(WebURLLoaderClient* client, WebURLLoader* lo ader, const WebURLResponse& response)
32 { 37 {
33 m_client = client; 38 m_client = client;
34 m_loader = loader; 39 m_loader = loader;
35 m_response = response; 40 m_response = response;
36 m_isReady = true; 41 m_isReady = true;
37 } 42 }
38 43
39 void SimRequest::didFail(const WebURLError& error) 44 void SimRequest::didFail(const WebURLError& error)
40 { 45 {
(...skipping 28 matching lines...) Expand all
69 74
70 void SimRequest::reset() 75 void SimRequest::reset()
71 { 76 {
72 m_isReady = false; 77 m_isReady = false;
73 m_client = nullptr; 78 m_client = nullptr;
74 m_loader = nullptr; 79 m_loader = nullptr;
75 SimNetwork::current().removeRequest(*this); 80 SimNetwork::current().removeRequest(*this);
76 } 81 }
77 82
78 } // namespace blink 83 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/tests/sim/SimRequest.h ('k') | Source/web/web.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698