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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 } | 377 } |
378 | 378 |
379 void TestingProfile::DestroyTopSites() { | 379 void TestingProfile::DestroyTopSites() { |
380 if (top_sites_.get()) { | 380 if (top_sites_.get()) { |
381 top_sites_->Shutdown(); | 381 top_sites_->Shutdown(); |
382 top_sites_ = NULL; | 382 top_sites_ = NULL; |
383 // TopSites::Shutdown schedules some tasks (from TopSitesBackend) that need | 383 // TopSites::Shutdown schedules some tasks (from TopSitesBackend) that need |
384 // to be run to properly shutdown. Run all pending tasks now. This is | 384 // to be run to properly shutdown. Run all pending tasks now. This is |
385 // normally handled by browser_process shutdown. | 385 // normally handled by browser_process shutdown. |
386 if (MessageLoop::current()) | 386 if (MessageLoop::current()) |
387 MessageLoop::current()->RunAllPending(); | 387 MessageLoop::current()->RunUntilIdle(); |
388 } | 388 } |
389 } | 389 } |
390 | 390 |
391 static ProfileKeyedService* BuildBookmarkModel(Profile* profile) { | 391 static ProfileKeyedService* BuildBookmarkModel(Profile* profile) { |
392 BookmarkModel* bookmark_model = new BookmarkModel(profile); | 392 BookmarkModel* bookmark_model = new BookmarkModel(profile); |
393 bookmark_model->Load(); | 393 bookmark_model->Load(); |
394 return bookmark_model; | 394 return bookmark_model; |
395 } | 395 } |
396 | 396 |
397 | 397 |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 824 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
825 DCHECK(!build_called_); | 825 DCHECK(!build_called_); |
826 build_called_ = true; | 826 build_called_ = true; |
827 return scoped_ptr<TestingProfile>(new TestingProfile( | 827 return scoped_ptr<TestingProfile>(new TestingProfile( |
828 path_, | 828 path_, |
829 delegate_, | 829 delegate_, |
830 extension_policy_, | 830 extension_policy_, |
831 pref_service_.Pass(), | 831 pref_service_.Pass(), |
832 user_cloud_policy_manager_.Pass())); | 832 user_cloud_policy_manager_.Pass())); |
833 } | 833 } |
OLD | NEW |