| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/testing_profile.h" | 5 #include "chrome/test/testing_profile.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/history/history_backend.h" | 8 #include "chrome/browser/history/history_backend.h" |
| 9 #include "chrome/common/chrome_constants.h" | 9 #include "chrome/common/chrome_constants.h" |
| 10 | 10 |
| 11 using base::Time; |
| 12 |
| 11 namespace { | 13 namespace { |
| 12 | 14 |
| 13 // BookmarkLoadObserver is used when blocking until the BookmarkModel | 15 // BookmarkLoadObserver is used when blocking until the BookmarkModel |
| 14 // finishes loading. As soon as the BookmarkModel finishes loading the message | 16 // finishes loading. As soon as the BookmarkModel finishes loading the message |
| 15 // loop is quit. | 17 // loop is quit. |
| 16 class BookmarkLoadObserver : public BookmarkModelObserver { | 18 class BookmarkLoadObserver : public BookmarkModelObserver { |
| 17 public: | 19 public: |
| 18 BookmarkLoadObserver() {} | 20 BookmarkLoadObserver() {} |
| 19 virtual void Loaded(BookmarkModel* model) { | 21 virtual void Loaded(BookmarkModel* model) { |
| 20 MessageLoop::current()->Quit(); | 22 MessageLoop::current()->Quit(); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 BookmarkLoadObserver observer; | 129 BookmarkLoadObserver observer; |
| 128 bookmark_bar_model_->AddObserver(&observer); | 130 bookmark_bar_model_->AddObserver(&observer); |
| 129 MessageLoop::current()->Run(); | 131 MessageLoop::current()->Run(); |
| 130 bookmark_bar_model_->RemoveObserver(&observer); | 132 bookmark_bar_model_->RemoveObserver(&observer); |
| 131 DCHECK(bookmark_bar_model_->IsLoaded()); | 133 DCHECK(bookmark_bar_model_->IsLoaded()); |
| 132 } | 134 } |
| 133 | 135 |
| 134 void TestingProfile::CreateTemplateURLModel() { | 136 void TestingProfile::CreateTemplateURLModel() { |
| 135 template_url_model_.reset(new TemplateURLModel(this)); | 137 template_url_model_.reset(new TemplateURLModel(this)); |
| 136 } | 138 } |
| OLD | NEW |