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

Side by Side Diff: webkit/glue/resource_fetcher_unittest.cc

Issue 9387011: Flakiness cleanup: disable flaky tests under webkit/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/glue/resource_fetcher.h" 5 #include "webkit/glue/resource_fetcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/timer.h" 10 #include "base/timer.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 bool completed_; 93 bool completed_;
94 bool timed_out_; 94 bool timed_out_;
95 WebURLResponse response_; 95 WebURLResponse response_;
96 std::string data_; 96 std::string data_;
97 }; 97 };
98 98
99 FetcherDelegate* FetcherDelegate::instance_ = NULL; 99 FetcherDelegate* FetcherDelegate::instance_ = NULL;
100 100
101 // Test a fetch from the test server. 101 // Test a fetch from the test server.
102 // Flaky, http://crbug.com/51622. 102 // Flaky, http://crbug.com/51622.
103 TEST_F(ResourceFetcherTests, FLAKY_ResourceFetcherDownload) { 103 TEST_F(ResourceFetcherTests, DISABLED_ResourceFetcherDownload) {
104 ASSERT_TRUE(test_server_.Start()); 104 ASSERT_TRUE(test_server_.Start());
105 105
106 WebFrame* frame = test_shell_->webView()->mainFrame(); 106 WebFrame* frame = test_shell_->webView()->mainFrame();
107 107
108 GURL url(test_server_.GetURL("files/test_shell/index.html")); 108 GURL url(test_server_.GetURL("files/test_shell/index.html"));
109 scoped_ptr<FetcherDelegate> delegate(new FetcherDelegate); 109 scoped_ptr<FetcherDelegate> delegate(new FetcherDelegate);
110 scoped_ptr<ResourceFetcher> fetcher(new ResourceFetcher( 110 scoped_ptr<ResourceFetcher> fetcher(new ResourceFetcher(
111 url, frame, WebURLRequest::TargetIsMainFrame, delegate->NewCallback())); 111 url, frame, WebURLRequest::TargetIsMainFrame, delegate->NewCallback()));
112 112
113 delegate->WaitForResponse(); 113 delegate->WaitForResponse();
(...skipping 11 matching lines...) Expand all
125 delegate->NewCallback())); 125 delegate->NewCallback()));
126 126
127 delegate->WaitForResponse(); 127 delegate->WaitForResponse();
128 128
129 ASSERT_TRUE(delegate->completed()); 129 ASSERT_TRUE(delegate->completed());
130 EXPECT_EQ(delegate->response().httpStatusCode(), 404); 130 EXPECT_EQ(delegate->response().httpStatusCode(), 404);
131 EXPECT_TRUE(delegate->data().find("Not Found.") != std::string::npos); 131 EXPECT_TRUE(delegate->data().find("Not Found.") != std::string::npos);
132 } 132 }
133 133
134 // Flaky, http://crbug.com/51622. 134 // Flaky, http://crbug.com/51622.
135 TEST_F(ResourceFetcherTests, FLAKY_ResourceFetcherDidFail) { 135 TEST_F(ResourceFetcherTests, DISABLED_ResourceFetcherDidFail) {
136 ASSERT_TRUE(test_server_.Start()); 136 ASSERT_TRUE(test_server_.Start());
137 137
138 WebFrame* frame = test_shell_->webView()->mainFrame(); 138 WebFrame* frame = test_shell_->webView()->mainFrame();
139 139
140 // Try to fetch a page on a site that doesn't exist. 140 // Try to fetch a page on a site that doesn't exist.
141 GURL url("http://localhost:1339/doesnotexist"); 141 GURL url("http://localhost:1339/doesnotexist");
142 scoped_ptr<FetcherDelegate> delegate(new FetcherDelegate); 142 scoped_ptr<FetcherDelegate> delegate(new FetcherDelegate);
143 scoped_ptr<ResourceFetcher> fetcher(new ResourceFetcher( 143 scoped_ptr<ResourceFetcher> fetcher(new ResourceFetcher(
144 url, frame, WebURLRequest::TargetIsMainFrame, delegate->NewCallback())); 144 url, frame, WebURLRequest::TargetIsMainFrame, delegate->NewCallback()));
145 145
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 scoped_ptr<ResourceFetcher> fetcher(new ResourceFetcherWithTimeout( 208 scoped_ptr<ResourceFetcher> fetcher(new ResourceFetcherWithTimeout(
209 url, frame, WebURLRequest::TargetIsMainFrame, 209 url, frame, WebURLRequest::TargetIsMainFrame,
210 0, delegate->NewCallback())); 210 0, delegate->NewCallback()));
211 delegate->SetFetcher(fetcher.release()); 211 delegate->SetFetcher(fetcher.release());
212 212
213 delegate->WaitForResponse(); 213 delegate->WaitForResponse();
214 EXPECT_FALSE(delegate->timed_out()); 214 EXPECT_FALSE(delegate->timed_out());
215 } 215 }
216 216
217 } // namespace 217 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698