| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 class TopSitesTest : public testing::Test { | 126 class TopSitesTest : public testing::Test { |
| 127 public: | 127 public: |
| 128 TopSitesTest() | 128 TopSitesTest() |
| 129 : ui_thread_(BrowserThread::UI, &message_loop_), | 129 : ui_thread_(BrowserThread::UI, &message_loop_), |
| 130 db_thread_(BrowserThread::DB, &message_loop_), | 130 db_thread_(BrowserThread::DB, &message_loop_), |
| 131 original_command_line_(*CommandLine::ForCurrentProcess()) { | 131 original_command_line_(*CommandLine::ForCurrentProcess()) { |
| 132 } | 132 } |
| 133 | 133 |
| 134 virtual void SetUp() { | 134 virtual void SetUp() { |
| 135 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableTopSites); | |
| 136 profile_.reset(new TestingProfile); | 135 profile_.reset(new TestingProfile); |
| 137 if (CreateHistoryAndTopSites()) { | 136 if (CreateHistoryAndTopSites()) { |
| 138 profile_->CreateHistoryService(false, false); | 137 profile_->CreateHistoryService(false, false); |
| 139 profile_->CreateTopSites(); | 138 profile_->CreateTopSites(); |
| 140 profile_->BlockUntilTopSitesLoaded(); | 139 profile_->BlockUntilTopSitesLoaded(); |
| 141 } | 140 } |
| 142 } | 141 } |
| 143 | 142 |
| 144 virtual void TearDown() { | 143 virtual void TearDown() { |
| 145 profile_.reset(); | 144 profile_.reset(); |
| (...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 WaitForTopSites(); | 1336 WaitForTopSites(); |
| 1338 EXPECT_FALSE(IsTopSitesLoaded()); | 1337 EXPECT_FALSE(IsTopSitesLoaded()); |
| 1339 | 1338 |
| 1340 // Load history, which should make TopSites finish loading too. | 1339 // Load history, which should make TopSites finish loading too. |
| 1341 profile()->CreateHistoryService(false, false); | 1340 profile()->CreateHistoryService(false, false); |
| 1342 profile()->BlockUntilTopSitesLoaded(); | 1341 profile()->BlockUntilTopSitesLoaded(); |
| 1343 EXPECT_TRUE(IsTopSitesLoaded()); | 1342 EXPECT_TRUE(IsTopSitesLoaded()); |
| 1344 } | 1343 } |
| 1345 | 1344 |
| 1346 } // namespace history | 1345 } // namespace history |
| OLD | NEW |