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

Side by Side Diff: chrome/test/base/browser_with_test_window_test.cc

Issue 1002803002: Classify navigations without page id in parallel to the existing classifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: relax the dcheck Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/test/base/browser_with_test_window_test.h" 5 #include "chrome/test/base/browser_with_test_window_test.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "chrome/browser/profiles/profile_destroyer.h" 8 #include "chrome/browser/profiles/profile_destroyer.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_navigator.h" 10 #include "chrome/browser/ui/browser_navigator.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (pending_rfh) 158 if (pending_rfh)
159 RenderFrameHostTester::For(old_rfh)->SimulateSwapOutACK(); 159 RenderFrameHostTester::For(old_rfh)->SimulateSwapOutACK();
160 160
161 // For new navigations, we need to send a larger page ID. For renavigations, 161 // For new navigations, we need to send a larger page ID. For renavigations,
162 // we need to send the preexisting page ID. We can tell these apart because 162 // we need to send the preexisting page ID. We can tell these apart because
163 // renavigations will have a pending_entry_index while new ones won't (they'll 163 // renavigations will have a pending_entry_index while new ones won't (they'll
164 // just have a standalong pending_entry that isn't in the list already). 164 // just have a standalong pending_entry that isn't in the list already).
165 if (controller->GetPendingEntryIndex() >= 0) { 165 if (controller->GetPendingEntryIndex() >= 0) {
166 test_rfh_tester->SendNavigateWithTransition( 166 test_rfh_tester->SendNavigateWithTransition(
167 controller->GetPendingEntry()->GetPageID(), 167 controller->GetPendingEntry()->GetPageID(),
168 controller->GetPendingEntry()->GetUniqueID(),
169 false,
168 controller->GetPendingEntry()->GetURL(), 170 controller->GetPendingEntry()->GetURL(),
169 controller->GetPendingEntry()->GetTransitionType()); 171 controller->GetPendingEntry()->GetTransitionType());
170 } else { 172 } else {
171 test_rfh_tester->SendNavigateWithTransition( 173 test_rfh_tester->SendNavigateWithTransition(
172 controller->GetWebContents()->GetMaxPageIDForSiteInstance( 174 controller->GetWebContents()->GetMaxPageIDForSiteInstance(
173 test_rfh->GetSiteInstance()) + 1, 175 test_rfh->GetSiteInstance()) + 1,
176 controller->GetPendingEntry()->GetUniqueID(),
177 true,
174 controller->GetPendingEntry()->GetURL(), 178 controller->GetPendingEntry()->GetURL(),
175 controller->GetPendingEntry()->GetTransitionType()); 179 controller->GetPendingEntry()->GetTransitionType());
176 } 180 }
177 } 181 }
178 182
179 void BrowserWithTestWindowTest::NavigateAndCommit( 183 void BrowserWithTestWindowTest::NavigateAndCommit(
180 NavigationController* controller, 184 NavigationController* controller,
181 const GURL& url) { 185 const GURL& url) {
182 controller->LoadURL( 186 controller->LoadURL(
183 url, content::Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); 187 url, content::Referrer(), ui::PAGE_TRANSITION_LINK, std::string());
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 255
252 #if !defined(OS_CHROMEOS) && defined(TOOLKIT_VIEWS) 256 #if !defined(OS_CHROMEOS) && defined(TOOLKIT_VIEWS)
253 views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() { 257 views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() {
254 #if defined(USE_ASH) 258 #if defined(USE_ASH)
255 return new ash::test::AshTestViewsDelegate; 259 return new ash::test::AshTestViewsDelegate;
256 #else 260 #else
257 return new views::TestViewsDelegate; 261 return new views::TestViewsDelegate;
258 #endif 262 #endif
259 } 263 }
260 #endif 264 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698