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

Unified Diff: chrome/browser/bookmarks/bookmark_drag_data_unittest.cc

Issue 342068: Third patch in getting rid of caching MessageLoop pointers and always using C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/bookmarks/bookmark_drag_data_unittest.cc
===================================================================
--- chrome/browser/bookmarks/bookmark_drag_data_unittest.cc (revision 30650)
+++ chrome/browser/bookmarks/bookmark_drag_data_unittest.cc (working copy)
@@ -4,15 +4,27 @@
#include "app/os_exchange_data.h"
#include "app/os_exchange_data_provider_win.h"
+#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/bookmarks/bookmark_drag_data.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/test/testing_profile.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
-typedef testing::Test BookmarkDragDataTest;
+class BookmarkDragDataTest : public testing::Test {
+ public:
+ BookmarkDragDataTest()
+ : ui_thread_(ChromeThread::UI, &loop_),
+ file_thread_(ChromeThread::FILE, &loop_) { }
+ private:
+ MessageLoop loop_;
+ ChromeThread ui_thread_;
+ ChromeThread file_thread_;
+};
+
namespace {
OSExchangeData::Provider* CloneProvider(const OSExchangeData& data) {
@@ -59,6 +71,7 @@
// Write a single node representing a URL to the clipboard.
TestingProfile profile;
profile.CreateBookmarkModel(false);
+ profile.BlockUntilBookmarkModelLoaded();
profile.SetID(L"id");
BookmarkModel* model = profile.GetBookmarkModel();
const BookmarkNode* root = model->GetBookmarkBarNode();
@@ -101,6 +114,7 @@
TEST_F(BookmarkDragDataTest, Group) {
TestingProfile profile;
profile.CreateBookmarkModel(false);
+ profile.BlockUntilBookmarkModelLoaded();
profile.SetID(L"id");
BookmarkModel* model = profile.GetBookmarkModel();
const BookmarkNode* root = model->GetBookmarkBarNode();
@@ -140,6 +154,7 @@
TestingProfile profile;
profile.SetID(L"id");
profile.CreateBookmarkModel(false);
+ profile.BlockUntilBookmarkModelLoaded();
BookmarkModel* model = profile.GetBookmarkModel();
const BookmarkNode* root = model->GetBookmarkBarNode();
const BookmarkNode* group = model->AddGroup(root, 0, L"g1");
@@ -178,6 +193,7 @@
TestingProfile profile;
profile.SetID(L"id");
profile.CreateBookmarkModel(false);
+ profile.BlockUntilBookmarkModelLoaded();
BookmarkModel* model = profile.GetBookmarkModel();
const BookmarkNode* root = model->GetBookmarkBarNode();
const BookmarkNode* group = model->AddGroup(root, 0, L"g1");

Powered by Google App Engine
This is Rietveld 408576698