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

Side by Side Diff: chrome/browser/browser_commands_unittest.cc

Issue 3133022: sync: take two for: "Added classes to enable session sync... (Closed)
Patch Set: Created 10 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/dom_ui/foreign_session_handler.h » ('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) 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/app/chrome_dll_resource.h" 5 #include "chrome/app/chrome_dll_resource.h"
6 #include "chrome/browser/bookmarks/bookmark_model.h" 6 #include "chrome/browser/bookmarks/bookmark_model.h"
7 #include "chrome/browser/browser.h" 7 #include "chrome/browser/browser.h"
8 #include "chrome/browser/browser_list.h" 8 #include "chrome/browser/browser_list.h"
9 #include "chrome/browser/chrome_thread.h" 9 #include "chrome/browser/chrome_thread.h"
10 #include "chrome/browser/tab_contents/navigation_controller.h" 10 #include "chrome/browser/tab_contents/navigation_controller.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 NavigationController& controller = 72 NavigationController& controller =
73 browser()->GetTabContentsAt(1)->controller(); 73 browser()->GetTabContentsAt(1)->controller();
74 ASSERT_EQ(3, controller.entry_count()); 74 ASSERT_EQ(3, controller.entry_count());
75 ASSERT_EQ(2, controller.GetCurrentEntryIndex()); 75 ASSERT_EQ(2, controller.GetCurrentEntryIndex());
76 ASSERT_TRUE(url1 == controller.GetEntryAtIndex(0)->url()); 76 ASSERT_TRUE(url1 == controller.GetEntryAtIndex(0)->url());
77 ASSERT_TRUE(url2 == controller.GetEntryAtIndex(1)->url()); 77 ASSERT_TRUE(url2 == controller.GetEntryAtIndex(1)->url());
78 ASSERT_TRUE(url3 == controller.GetEntryAtIndex(2)->url()); 78 ASSERT_TRUE(url3 == controller.GetEntryAtIndex(2)->url());
79 } 79 }
80 80
81 TEST_F(BrowserCommandsTest, BookmarkCurrentPage) { 81 TEST_F(BrowserCommandsTest, BookmarkCurrentPage) {
82 ChromeThread ui_loop(ChromeThread::UI, MessageLoop::current());
83 ChromeThread file_loop(ChromeThread::FILE, MessageLoop::current()); 82 ChromeThread file_loop(ChromeThread::FILE, MessageLoop::current());
84 // We use profile() here, since it's a TestingProfile. 83 // We use profile() here, since it's a TestingProfile.
85 profile()->CreateBookmarkModel(true); 84 profile()->CreateBookmarkModel(true);
86 profile()->BlockUntilBookmarkModelLoaded(); 85 profile()->BlockUntilBookmarkModelLoaded();
87 86
88 // Navigate to a url. 87 // Navigate to a url.
89 GURL url1("http://foo/1"); 88 GURL url1("http://foo/1");
90 AddTab(browser(), url1); 89 AddTab(browser(), url1);
91 browser()->OpenURL(url1, GURL(), CURRENT_TAB, PageTransition::TYPED); 90 browser()->OpenURL(url1, GURL(), CURRENT_TAB, PageTransition::TYPED);
92 91
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 ASSERT_EQ(3, browser()->selected_index()); 160 ASSERT_EQ(3, browser()->selected_index());
162 ASSERT_EQ(url1, browser()->GetSelectedTabContents()->GetURL()); 161 ASSERT_EQ(url1, browser()->GetSelectedTabContents()->GetURL());
163 162
164 // Same thing again for forward. 163 // Same thing again for forward.
165 // TODO(brettw) bug 11055: see the comment above about why we need this. 164 // TODO(brettw) bug 11055: see the comment above about why we need this.
166 CommitPendingLoad(&browser()->GetSelectedTabContents()->controller()); 165 CommitPendingLoad(&browser()->GetSelectedTabContents()->controller());
167 browser()->GoForward(NEW_FOREGROUND_TAB); 166 browser()->GoForward(NEW_FOREGROUND_TAB);
168 ASSERT_EQ(4, browser()->selected_index()); 167 ASSERT_EQ(4, browser()->selected_index());
169 ASSERT_EQ(url2, browser()->GetSelectedTabContents()->GetURL()); 168 ASSERT_EQ(url2, browser()->GetSelectedTabContents()->GetURL());
170 } 169 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/dom_ui/foreign_session_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698