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

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler_unittest.cc

Issue 412143009: Moved data reduction proxy initialization logic to ProfileImplIOData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler_unittest.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler_unittest.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler_unittest.cc
index 8b0e950cf9281e073f3517ddde5e8c104775a625..939374a232376657f7c7acf5215d5605302a520d 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler_unittest.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler_unittest.cc
@@ -46,8 +46,9 @@ class TestDataReductionProxyAuthRequestHandler
: public DataReductionProxyAuthRequestHandler {
public:
TestDataReductionProxyAuthRequestHandler(
- DataReductionProxyParams* params)
- : DataReductionProxyAuthRequestHandler(params) {}
+ DataReductionProxyParams* params,
+ base::MessageLoopProxy* loop_proxy)
+ : DataReductionProxyAuthRequestHandler(params, loop_proxy) {}
virtual std::string GetDefaultKey() const OVERRIDE {
return kTestKey;
@@ -68,6 +69,13 @@ class TestDataReductionProxyAuthRequestHandler
} // namespace
class DataReductionProxyAuthRequestHandlerTest : public testing::Test {
+ public:
+ DataReductionProxyAuthRequestHandlerTest()
+ : loop_proxy_(base::MessageLoopProxy::current().get()) {
+ }
+ // Required for MessageLoopProxy::current().
+ base::MessageLoopForUI loop_;
+ base::MessageLoopProxy* loop_proxy_;
};
TEST_F(DataReductionProxyAuthRequestHandlerTest, Authorization) {
@@ -79,8 +87,10 @@ TEST_F(DataReductionProxyAuthRequestHandlerTest, Authorization) {
DataReductionProxyParams::kPromoAllowed,
TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN));
- TestDataReductionProxyAuthRequestHandler auth_handler(params.get());
+ TestDataReductionProxyAuthRequestHandler auth_handler(params.get(),
+ loop_proxy_);
auth_handler.Init();
+ base::MessageLoop::current()->RunUntilIdle();
#if defined(OS_ANDROID)
EXPECT_EQ(auth_handler.client_, "android");
#elif defined(OS_IOS)
@@ -95,6 +105,7 @@ TEST_F(DataReductionProxyAuthRequestHandlerTest, Authorization) {
// Now set a key.
auth_handler.SetKey(kTestKey2, kClient2, kVersion2);
+ base::MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kClient2, auth_handler.client_);
EXPECT_EQ(kVersion2, auth_handler.version_);
EXPECT_EQ(kTestKey2, auth_handler.key_);

Powered by Google App Engine
This is Rietveld 408576698