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

Side by Side Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest.cc

Issue 60923002: [sync] Allow FakeURLFetcher to return an arbitrary URLRequestStatus (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/net/spdyproxy/data_reduction_proxy_settings_unittest.h" 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/md5.h" 8 #include "base/md5.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 static_cast<MockDataReductionProxySettings<C>*>(settings_.get()); 116 static_cast<MockDataReductionProxySettings<C>*>(settings_.get());
117 if (0 == expected_calls) { 117 if (0 == expected_calls) {
118 EXPECT_CALL(*settings, GetURLFetcher()).Times(0); 118 EXPECT_CALL(*settings, GetURLFetcher()).Times(0);
119 } else { 119 } else {
120 EXPECT_CALL(*settings, GetURLFetcher()) 120 EXPECT_CALL(*settings, GetURLFetcher())
121 .Times(expected_calls) 121 .Times(expected_calls)
122 .WillRepeatedly(Return(new net::FakeURLFetcher( 122 .WillRepeatedly(Return(new net::FakeURLFetcher(
123 GURL(test_url), 123 GURL(test_url),
124 settings, 124 settings,
125 response, 125 response,
126 success ? net::HTTP_OK : net::HTTP_INTERNAL_SERVER_ERROR))); 126 success ? net::HTTP_OK : net::HTTP_INTERNAL_SERVER_ERROR,
127 success ? net::URLRequestStatus::SUCCESS :
128 net::URLRequestStatus::FAILED)));
127 } 129 }
128 } 130 }
129 131
130 // Explicitly generate required instantiations. 132 // Explicitly generate required instantiations.
131 template void 133 template void
132 DataReductionProxySettingsTestBase::SetProbeResult<DataReductionProxySettings>( 134 DataReductionProxySettingsTestBase::SetProbeResult<DataReductionProxySettings>(
133 const std::string& test_url, 135 const std::string& test_url,
134 const std::string& response, 136 const std::string& response,
135 bool success, 137 bool success,
136 int expected_calls); 138 int expected_calls);
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 "http://*bat.com" 553 "http://*bat.com"
552 }; 554 };
553 555
554 ASSERT_EQ(settings_->bypass_rules_.size(), 6u); 556 ASSERT_EQ(settings_->bypass_rules_.size(), 6u);
555 int i = 0; 557 int i = 0;
556 for (std::vector<std::string>::iterator it = settings_->bypass_rules_.begin(); 558 for (std::vector<std::string>::iterator it = settings_->bypass_rules_.begin();
557 it != settings_->bypass_rules_.end(); ++it) { 559 it != settings_->bypass_rules_.end(); ++it) {
558 EXPECT_EQ(expected[i++], *it); 560 EXPECT_EQ(expected[i++], *it);
559 } 561 }
560 } 562 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698