Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: chrome/browser/browser_commands_unittest.cc

Issue 12929016: bookmarks: Get rid of TestingProfile::BlockUntilBookmarkModelLoaded(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browser_commands_unittest.cc
diff --git a/chrome/browser/browser_commands_unittest.cc b/chrome/browser/browser_commands_unittest.cc
index 1422469a877d386e90b5ccae133a66f79373b37b..8ee05a642d7d8d3c4d2b6a22ed3872db7fc2ddc2 100644
--- a/chrome/browser/browser_commands_unittest.cc
+++ b/chrome/browser/browser_commands_unittest.cc
@@ -12,6 +12,7 @@
#include "chrome/common/url_constants.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/testing_profile.h"
+#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
@@ -139,7 +140,9 @@ TEST_F(BrowserCommandsTest, ViewSource) {
TEST_F(BrowserCommandsTest, BookmarkCurrentPage) {
// We use profile() here, since it's a TestingProfile.
profile()->CreateBookmarkModel(true);
- profile()->BlockUntilBookmarkModelLoaded();
+
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
+ ui_test_utils::WaitForBookmarkModelToLoad(model);
// Navigate to a url.
GURL url1("http://foo/1");
@@ -151,8 +154,7 @@ TEST_F(BrowserCommandsTest, BookmarkCurrentPage) {
// It should now be bookmarked in the bookmark model.
EXPECT_EQ(profile(), browser()->profile());
- EXPECT_TRUE(BookmarkModelFactory::GetForProfile(
- browser()->profile())->IsBookmarked(url1));
+ EXPECT_TRUE(model->IsBookmarked(url1));
}
// Tests back/forward in new tab (Control + Back/Forward button in the UI).

Powered by Google App Engine
This is Rietveld 408576698