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

Side by Side Diff: components/update_client/update_checker_unittest.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop/message_loop.h"
13 #include "base/path_service.h" 12 #include "base/path_service.h"
14 #include "base/run_loop.h" 13 #include "base/run_loop.h"
14 #include "base/thread_task_runner_handle.h"
15 #include "base/version.h" 15 #include "base/version.h"
16 #include "components/update_client/crx_update_item.h" 16 #include "components/update_client/crx_update_item.h"
17 #include "components/update_client/test_configurator.h" 17 #include "components/update_client/test_configurator.h"
18 #include "components/update_client/update_checker.h" 18 #include "components/update_client/update_checker.h"
19 #include "components/update_client/url_request_post_interceptor.h" 19 #include "components/update_client/url_request_post_interceptor.h"
20 #include "net/url_request/url_request_test_util.h" 20 #include "net/url_request/url_request_test_util.h"
21 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
22 #include "url/gurl.h" 22 #include "url/gurl.h"
23 23
24 using std::string; 24 using std::string;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 DISALLOW_COPY_AND_ASSIGN(UpdateCheckerTest); 79 DISALLOW_COPY_AND_ASSIGN(UpdateCheckerTest);
80 }; 80 };
81 81
82 UpdateCheckerTest::UpdateCheckerTest() : post_interceptor_(NULL), error_(0) { 82 UpdateCheckerTest::UpdateCheckerTest() : post_interceptor_(NULL), error_(0) {
83 } 83 }
84 84
85 UpdateCheckerTest::~UpdateCheckerTest() { 85 UpdateCheckerTest::~UpdateCheckerTest() {
86 } 86 }
87 87
88 void UpdateCheckerTest::SetUp() { 88 void UpdateCheckerTest::SetUp() {
89 config_ = new TestConfigurator(base::MessageLoopProxy::current(), 89 config_ = new TestConfigurator(base::ThreadTaskRunnerHandle::Get(),
90 base::MessageLoopProxy::current()); 90 base::ThreadTaskRunnerHandle::Get());
91 interceptor_factory_.reset( 91 interceptor_factory_.reset(
92 new InterceptorFactory(base::MessageLoopProxy::current())); 92 new InterceptorFactory(base::ThreadTaskRunnerHandle::Get()));
93 post_interceptor_ = interceptor_factory_->CreateInterceptor(); 93 post_interceptor_ = interceptor_factory_->CreateInterceptor();
94 EXPECT_TRUE(post_interceptor_); 94 EXPECT_TRUE(post_interceptor_);
95 95
96 update_checker_.reset(); 96 update_checker_.reset();
97 97
98 error_ = 0; 98 error_ = 0;
99 error_message_.clear(); 99 error_message_.clear();
100 results_ = UpdateResponse::Results(); 100 results_ = UpdateResponse::Results();
101 } 101 }
102 102
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 EXPECT_EQ(1, post_interceptor_->GetCount()) 228 EXPECT_EQ(1, post_interceptor_->GetCount())
229 << post_interceptor_->GetRequestsAsString(); 229 << post_interceptor_->GetRequestsAsString();
230 230
231 EXPECT_EQ(config_->UpdateUrl().front(), original_url_); 231 EXPECT_EQ(config_->UpdateUrl().front(), original_url_);
232 EXPECT_EQ(403, error_); 232 EXPECT_EQ(403, error_);
233 EXPECT_STREQ("network error", error_message_.c_str()); 233 EXPECT_STREQ("network error", error_message_.c_str());
234 EXPECT_EQ(0ul, results_.list.size()); 234 EXPECT_EQ(0ul, results_.list.size());
235 } 235 }
236 236
237 } // namespace update_client 237 } // namespace update_client
OLDNEW
« no previous file with comments | « components/update_client/request_sender_unittest.cc ('k') | components/visitedlink/test/visitedlink_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698