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

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

Issue 2873533002: Prepare to abstract PersistedData by making it part of the configurator.
Patch Set: Rename pref_ to pref_service_. Created 3 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 "components/update_client/update_checker.h" 5 #include "components/update_client/update_checker.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 DISALLOW_COPY_AND_ASSIGN(UpdateCheckerTest); 93 DISALLOW_COPY_AND_ASSIGN(UpdateCheckerTest);
94 }; 94 };
95 95
96 UpdateCheckerTest::UpdateCheckerTest() : scoped_task_scheduler_(&loop_) {} 96 UpdateCheckerTest::UpdateCheckerTest() : scoped_task_scheduler_(&loop_) {}
97 97
98 UpdateCheckerTest::~UpdateCheckerTest() { 98 UpdateCheckerTest::~UpdateCheckerTest() {
99 } 99 }
100 100
101 void UpdateCheckerTest::SetUp() { 101 void UpdateCheckerTest::SetUp() {
102 pref_ = base::MakeUnique<TestingPrefServiceSimple>();
102 config_ = base::MakeRefCounted<TestConfigurator>( 103 config_ = base::MakeRefCounted<TestConfigurator>(
103 base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get()); 104 base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get());
104 pref_ = base::MakeUnique<TestingPrefServiceSimple>();
105 PersistedData::RegisterPrefs(pref_->registry()); 105 PersistedData::RegisterPrefs(pref_->registry());
106 metadata_ = base::MakeUnique<PersistedData>(pref_.get()); 106 metadata_ = base::MakeUnique<PersistedData>(pref_.get());
107 interceptor_factory_ = 107 interceptor_factory_ =
108 base::MakeUnique<InterceptorFactory>(base::ThreadTaskRunnerHandle::Get()); 108 base::MakeUnique<InterceptorFactory>(base::ThreadTaskRunnerHandle::Get());
109 post_interceptor_ = interceptor_factory_->CreateInterceptor(); 109 post_interceptor_ = interceptor_factory_->CreateInterceptor();
110 EXPECT_TRUE(post_interceptor_); 110 EXPECT_TRUE(post_interceptor_);
111 111
112 update_checker_ = nullptr; 112 update_checker_ = nullptr;
113 113
114 error_ = 0; 114 error_ = 0;
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 EXPECT_EQ(1, post_interceptor_->GetHitCount()) 559 EXPECT_EQ(1, post_interceptor_->GetHitCount())
560 << post_interceptor_->GetRequestsAsString(); 560 << post_interceptor_->GetRequestsAsString();
561 ASSERT_EQ(1, post_interceptor_->GetCount()) 561 ASSERT_EQ(1, post_interceptor_->GetCount())
562 << post_interceptor_->GetRequestsAsString(); 562 << post_interceptor_->GetRequestsAsString();
563 563
564 EXPECT_EQ(0, error_); 564 EXPECT_EQ(0, error_);
565 EXPECT_STREQ("this", component->action_run_.c_str()); 565 EXPECT_STREQ("this", component->action_run_.c_str());
566 } 566 }
567 567
568 } // namespace update_client 568 } // namespace update_client
OLDNEW
« no previous file with comments | « components/update_client/test_configurator.cc ('k') | components/update_client/update_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698