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

Side by Side Diff: components/sync_bookmarks/bookmark_data_type_controller_unittest.cc

Issue 1841653003: Drop |languages| from {Format,Elide}Url* and IDNToUnicode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo in elide_url.cc Created 4 years, 8 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 (c) 2012 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 "components/sync_bookmarks/bookmark_data_type_controller.h" 5 #include "components/sync_bookmarks/bookmark_data_type_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 enum BookmarkLoadPolicy { 84 enum BookmarkLoadPolicy {
85 DONT_LOAD_MODEL, 85 DONT_LOAD_MODEL,
86 LOAD_MODEL, 86 LOAD_MODEL,
87 }; 87 };
88 88
89 void CreateBookmarkModel(BookmarkLoadPolicy bookmark_load_policy) { 89 void CreateBookmarkModel(BookmarkLoadPolicy bookmark_load_policy) {
90 bookmark_model_.reset(new BookmarkModel( 90 bookmark_model_.reset(new BookmarkModel(
91 make_scoped_ptr(new bookmarks::TestBookmarkClient()))); 91 make_scoped_ptr(new bookmarks::TestBookmarkClient())));
92 if (bookmark_load_policy == LOAD_MODEL) { 92 if (bookmark_load_policy == LOAD_MODEL) {
93 TestingPrefServiceSimple prefs; 93 TestingPrefServiceSimple prefs;
94 bookmark_model_->Load(&prefs, std::string(), base::FilePath(), 94 bookmark_model_->Load(&prefs, base::FilePath(),
95 base::ThreadTaskRunnerHandle::Get(), 95 base::ThreadTaskRunnerHandle::Get(),
96 base::ThreadTaskRunnerHandle::Get()); 96 base::ThreadTaskRunnerHandle::Get());
97 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_.get()); 97 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_.get());
98 } 98 }
99 } 99 }
100 100
101 void SetStartExpectations() { 101 void SetStartExpectations() {
102 EXPECT_CALL(*history_service_.get(), BackendLoaded()) 102 EXPECT_CALL(*history_service_.get(), BackendLoaded())
103 .WillRepeatedly(Return(true)); 103 .WillRepeatedly(Return(true));
104 EXPECT_CALL(model_load_callback_, Run(_, _)); 104 EXPECT_CALL(model_load_callback_, Run(_, _));
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 SetStartExpectations(); 162 SetStartExpectations();
163 SetAssociateExpectations(); 163 SetAssociateExpectations();
164 164
165 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _)); 165 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _));
166 bookmark_dtc_->LoadModels( 166 bookmark_dtc_->LoadModels(
167 base::Bind(&ModelLoadCallbackMock::Run, 167 base::Bind(&ModelLoadCallbackMock::Run,
168 base::Unretained(&model_load_callback_))); 168 base::Unretained(&model_load_callback_)));
169 EXPECT_EQ(DataTypeController::MODEL_STARTING, bookmark_dtc_->state()); 169 EXPECT_EQ(DataTypeController::MODEL_STARTING, bookmark_dtc_->state());
170 170
171 TestingPrefServiceSimple prefs; 171 TestingPrefServiceSimple prefs;
172 bookmark_model_->Load(&prefs, std::string(), base::FilePath(), 172 bookmark_model_->Load(&prefs, base::FilePath(),
173 base::ThreadTaskRunnerHandle::Get(), 173 base::ThreadTaskRunnerHandle::Get(),
174 base::ThreadTaskRunnerHandle::Get()); 174 base::ThreadTaskRunnerHandle::Get());
175 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_.get()); 175 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_.get());
176 EXPECT_EQ(DataTypeController::MODEL_LOADED, bookmark_dtc_->state()); 176 EXPECT_EQ(DataTypeController::MODEL_LOADED, bookmark_dtc_->state());
177 177
178 bookmark_dtc_->StartAssociating( 178 bookmark_dtc_->StartAssociating(
179 base::Bind(&StartCallbackMock::Run, 179 base::Bind(&StartCallbackMock::Run,
180 base::Unretained(&start_callback_))); 180 base::Unretained(&start_callback_)));
181 base::MessageLoop::current()->RunUntilIdle(); 181 base::MessageLoop::current()->RunUntilIdle();
182 182
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 SetStopExpectations(); 296 SetStopExpectations();
297 297
298 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); 298 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state());
299 299
300 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _)); 300 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _));
301 Start(); 301 Start();
302 EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state()); 302 EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state());
303 bookmark_dtc_->Stop(); 303 bookmark_dtc_->Stop();
304 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); 304 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state());
305 } 305 }
OLDNEW
« no previous file with comments | « components/security_interstitials/core/ssl_error_ui.cc ('k') | components/toolbar/toolbar_model_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698