| 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 if (delete_file) { | 401 if (delete_file) { |
| 402 base::FilePath path = GetPath().Append(chrome::kBookmarksFileName); | 402 base::FilePath path = GetPath().Append(chrome::kBookmarksFileName); |
| 403 file_util::Delete(path, false); | 403 file_util::Delete(path, false); |
| 404 } | 404 } |
| 405 // This will create a bookmark model. | 405 // This will create a bookmark model. |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 | 779 |
| 780 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 780 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
| 781 DCHECK(!build_called_); | 781 DCHECK(!build_called_); |
| 782 build_called_ = true; | 782 build_called_ = true; |
| 783 return scoped_ptr<TestingProfile>(new TestingProfile( | 783 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 784 path_, | 784 path_, |
| 785 delegate_, | 785 delegate_, |
| 786 extension_policy_, | 786 extension_policy_, |
| 787 pref_service_.Pass())); | 787 pref_service_.Pass())); |
| 788 } | 788 } |
| OLD | NEW |