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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc

Issue 6627060: ImportantFileWriter: check return value of PostTask... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/browser_test_helper.cc ('k') | chrome/common/important_file_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "chrome/browser/bookmarks/bookmark_model.h" 6 #include "chrome/browser/bookmarks/bookmark_model.h"
7 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 7 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
8 #include "chrome/test/browser_with_test_window_test.h" 8 #include "chrome/test/browser_with_test_window_test.h"
9 #include "chrome/test/testing_profile.h" 9 #include "chrome/test/testing_profile.h"
10 #include "content/browser/browser_thread.h" 10 #include "content/browser/browser_thread.h"
11 11
12 class BookmarkBarViewTest : public BrowserWithTestWindowTest { 12 typedef BrowserWithTestWindowTest BookmarkBarViewTest;
13 public:
14 BookmarkBarViewTest()
15 : file_thread_(BrowserThread::FILE, message_loop()) {}
16
17 private:
18 BrowserThread file_thread_;
19
20 DISALLOW_COPY_AND_ASSIGN(BookmarkBarViewTest);
21 };
22 13
23 TEST_F(BookmarkBarViewTest, SwitchProfile) { 14 TEST_F(BookmarkBarViewTest, SwitchProfile) {
24 profile()->CreateBookmarkModel(true); 15 profile()->CreateBookmarkModel(true);
25 profile()->BlockUntilBookmarkModelLoaded(); 16 profile()->BlockUntilBookmarkModelLoaded();
26 17
27 profile()->GetBookmarkModel()->AddURL( 18 profile()->GetBookmarkModel()->AddURL(
28 profile()->GetBookmarkModel()->GetBookmarkBarNode(), 19 profile()->GetBookmarkModel()->GetBookmarkBarNode(),
29 0, 20 0,
30 ASCIIToUTF16("blah"), 21 ASCIIToUTF16("blah"),
31 GURL("http://www.google.com")); 22 GURL("http://www.google.com"));
32 23
33 BookmarkBarView bookmark_bar(profile(), browser()); 24 BookmarkBarView bookmark_bar(profile(), browser());
34 25
35 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount()); 26 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount());
36 27
37 TestingProfile profile2; 28 TestingProfile profile2;
38 profile2.CreateBookmarkModel(true); 29 profile2.CreateBookmarkModel(true);
39 profile2.BlockUntilBookmarkModelLoaded(); 30 profile2.BlockUntilBookmarkModelLoaded();
40 31
41 bookmark_bar.SetProfile(&profile2); 32 bookmark_bar.SetProfile(&profile2);
42 33
43 EXPECT_EQ(0, bookmark_bar.GetBookmarkButtonCount()); 34 EXPECT_EQ(0, bookmark_bar.GetBookmarkButtonCount());
44 35
45 bookmark_bar.SetProfile(profile()); 36 bookmark_bar.SetProfile(profile());
46 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount()); 37 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount());
47 } 38 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_test_helper.cc ('k') | chrome/common/important_file_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698