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

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

Issue 3127017: Revert 56423 - Added classes to enable session sync functionality.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
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 | Annotate | Revision Log
« 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());
82 ChromeThread file_loop(ChromeThread::FILE, MessageLoop::current()); 83 ChromeThread file_loop(ChromeThread::FILE, MessageLoop::current());
83 // We use profile() here, since it's a TestingProfile. 84 // We use profile() here, since it's a TestingProfile.
84 profile()->CreateBookmarkModel(true); 85 profile()->CreateBookmarkModel(true);
85 profile()->BlockUntilBookmarkModelLoaded(); 86 profile()->BlockUntilBookmarkModelLoaded();
86 87
87 // Navigate to a url. 88 // Navigate to a url.
88 GURL url1("http://foo/1"); 89 GURL url1("http://foo/1");
89 AddTab(browser(), url1); 90 AddTab(browser(), url1);
90 browser()->OpenURL(url1, GURL(), CURRENT_TAB, PageTransition::TYPED); 91 browser()->OpenURL(url1, GURL(), CURRENT_TAB, PageTransition::TYPED);
91 92
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 ASSERT_EQ(3, browser()->selected_index()); 161 ASSERT_EQ(3, browser()->selected_index());
161 ASSERT_EQ(url1, browser()->GetSelectedTabContents()->GetURL()); 162 ASSERT_EQ(url1, browser()->GetSelectedTabContents()->GetURL());
162 163
163 // Same thing again for forward. 164 // Same thing again for forward.
164 // TODO(brettw) bug 11055: see the comment above about why we need this. 165 // TODO(brettw) bug 11055: see the comment above about why we need this.
165 CommitPendingLoad(&browser()->GetSelectedTabContents()->controller()); 166 CommitPendingLoad(&browser()->GetSelectedTabContents()->controller());
166 browser()->GoForward(NEW_FOREGROUND_TAB); 167 browser()->GoForward(NEW_FOREGROUND_TAB);
167 ASSERT_EQ(4, browser()->selected_index()); 168 ASSERT_EQ(4, browser()->selected_index());
168 ASSERT_EQ(url2, browser()->GetSelectedTabContents()->GetURL()); 169 ASSERT_EQ(url2, browser()->GetSelectedTabContents()->GetURL());
169 } 170 }
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