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

Side by Side Diff: chrome_frame/test/header_test.cc

Issue 9323031: Fix flakiness in Chrome Frame HeaderTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright year 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) 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 "chrome_frame/test/mock_ie_event_sink_actions.h" 5 #include "chrome_frame/test/mock_ie_event_sink_actions.h"
6 #include "chrome_frame/test/mock_ie_event_sink_test.h" 6 #include "chrome_frame/test/mock_ie_event_sink_test.h"
7 #include "base/rand_util.h" 7 #include "base/rand_util.h"
8 8
9 namespace chrome_frame_test { 9 namespace chrome_frame_test {
10 10
11 class TestData { 11 class TestData {
(...skipping 20 matching lines...) Expand all
32 void ExpectOnServer(MockWebServer* server_mock) const { 32 void ExpectOnServer(MockWebServer* server_mock) const {
33 EXPECT_CALL(*server_mock, Get(testing::_, GetPath(), testing::_)) 33 EXPECT_CALL(*server_mock, Get(testing::_, GetPath(), testing::_))
34 .Times(testing::AnyNumber()) 34 .Times(testing::AnyNumber())
35 .WillRepeatedly(SendFast(GetHeaders(), GetHtml())); 35 .WillRepeatedly(SendFast(GetHeaders(), GetHtml()));
36 } 36 }
37 37
38 std::string GetHeaders() const { 38 std::string GetHeaders() const {
39 std::ostringstream headers; 39 std::ostringstream headers;
40 headers << "HTTP/1.1 200 OK\r\n" 40 headers << "HTTP/1.1 200 OK\r\n"
41 << "Connection: close\r\n" 41 << "Connection: close\r\n"
42 << "Content-Type: text/html\r\n"; 42 << "Content-Type: text/html\r\n"
43 << "Cache-Control: no-cache\r\n";
43 if (in_header_) { 44 if (in_header_) {
44 headers << "X-UA-COMPATIBLE: " << value_ << "\r\n"; 45 headers << "X-UA-COMPATIBLE: " << value_ << "\r\n";
45 } 46 }
46 return headers.str(); 47 return headers.str();
47 } 48 }
48 49
49 std::string GetHtml() const { 50 std::string GetHtml() const {
50 std::ostringstream html; 51 std::ostringstream html;
51 html << "<html><head>"; 52 html << "<html><head>";
52 if (!in_header_) { 53 if (!in_header_) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 GetParam().ExpectOnServer(&server_mock_); 178 GetParam().ExpectOnServer(&server_mock_);
178 ie_mock_.ExpectNavigation(expected_renderer, url); 179 ie_mock_.ExpectNavigation(expected_renderer, url);
179 180
180 EXPECT_CALL(ie_mock_, OnLoad(expected_renderer, testing::StrEq(url))) 181 EXPECT_CALL(ie_mock_, OnLoad(expected_renderer, testing::StrEq(url)))
181 .WillOnce(CloseBrowserMock(&ie_mock_)); 182 .WillOnce(CloseBrowserMock(&ie_mock_));
182 183
183 LaunchIEAndNavigate(url); 184 LaunchIEAndNavigate(url);
184 } 185 }
185 186
186 } // namespace chrome_frame_test 187 } // namespace chrome_frame_test
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