| 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 | 787 |
| 788 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 788 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
| 789 DCHECK(!build_called_); | 789 DCHECK(!build_called_); |
| 790 build_called_ = true; | 790 build_called_ = true; |
| 791 return scoped_ptr<TestingProfile>(new TestingProfile( | 791 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 792 path_, | 792 path_, |
| 793 delegate_, | 793 delegate_, |
| 794 extension_policy_, | 794 extension_policy_, |
| 795 pref_service_.Pass())); | 795 pref_service_.Pass())); |
| 796 } | 796 } |
| OLD | NEW |