OLD | NEW |
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 "chrome/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // TopSites::Shutdown schedules some tasks (from TopSitesBackend) that need | 385 // TopSites::Shutdown schedules some tasks (from TopSitesBackend) that need |
386 // to be run to properly shutdown. Run all pending tasks now. This is | 386 // to be run to properly shutdown. Run all pending tasks now. This is |
387 // normally handled by browser_process shutdown. | 387 // normally handled by browser_process shutdown. |
388 if (MessageLoop::current()) | 388 if (MessageLoop::current()) |
389 MessageLoop::current()->RunUntilIdle(); | 389 MessageLoop::current()->RunUntilIdle(); |
390 } | 390 } |
391 } | 391 } |
392 | 392 |
393 static ProfileKeyedService* BuildBookmarkModel(Profile* profile) { | 393 static ProfileKeyedService* BuildBookmarkModel(Profile* profile) { |
394 BookmarkModel* bookmark_model = new BookmarkModel(profile); | 394 BookmarkModel* bookmark_model = new BookmarkModel(profile); |
395 bookmark_model->Load(); | 395 bookmark_model->Load(profile->GetIOTaskRunner()); |
396 return bookmark_model; | 396 return bookmark_model; |
397 } | 397 } |
398 | 398 |
399 | 399 |
400 void TestingProfile::CreateBookmarkModel(bool delete_file) { | 400 void TestingProfile::CreateBookmarkModel(bool delete_file) { |
401 | 401 |
402 if (delete_file) { | 402 if (delete_file) { |
403 base::FilePath path = GetPath(); | 403 base::FilePath path = GetPath(); |
404 path = path.Append(chrome::kBookmarksFileName); | 404 path = path.Append(chrome::kBookmarksFileName); |
405 file_util::Delete(path, false); | 405 file_util::Delete(path, false); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 | 796 |
797 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 797 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
798 DCHECK(!build_called_); | 798 DCHECK(!build_called_); |
799 build_called_ = true; | 799 build_called_ = true; |
800 return scoped_ptr<TestingProfile>(new TestingProfile( | 800 return scoped_ptr<TestingProfile>(new TestingProfile( |
801 path_, | 801 path_, |
802 delegate_, | 802 delegate_, |
803 extension_policy_, | 803 extension_policy_, |
804 pref_service_.Pass())); | 804 pref_service_.Pass())); |
805 } | 805 } |
OLD | NEW |