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

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

Issue 2561493003: Rework of ResourcePrefetchPredictor browser tests infrastructure. (Closed)
Patch Set: Created 4 years 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/ui_test_utils.h" 5 #include "chrome/test/base/ui_test_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // We've opened up a new tab, but not selected it. 206 // We've opened up a new tab, but not selected it.
207 TabStripModel* tab_strip = browser->tab_strip_model(); 207 TabStripModel* tab_strip = browser->tab_strip_model();
208 web_contents = tab_strip->GetWebContentsAt(tab_strip->active_index() + 1); 208 web_contents = tab_strip->GetWebContentsAt(tab_strip->active_index() + 1);
209 EXPECT_TRUE(web_contents != NULL) 209 EXPECT_TRUE(web_contents != NULL)
210 << " Unable to wait for navigation to \"" << url.spec() 210 << " Unable to wait for navigation to \"" << url.spec()
211 << "\" because the new tab is not available yet"; 211 << "\" because the new tab is not available yet";
212 if (!web_contents) 212 if (!web_contents)
213 return; 213 return;
214 } else if ((disposition == WindowOpenDisposition::CURRENT_TAB) || 214 } else if ((disposition == WindowOpenDisposition::CURRENT_TAB) ||
215 (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB) || 215 (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB) ||
216 (disposition == WindowOpenDisposition::SINGLETON_TAB)) { 216 (disposition == WindowOpenDisposition::SINGLETON_TAB) ||
217 (disposition == WindowOpenDisposition::NEW_POPUP)) {
ahemery 2016/12/07 14:13:02 I believe this one was just forgotten. Behavior wa
alexilin 2016/12/07 16:57:11 We don't need it for this CL anymore.
217 // The currently selected tab is the right one. 218 // The currently selected tab is the right one.
218 web_contents = browser->tab_strip_model()->GetActiveWebContents(); 219 web_contents = browser->tab_strip_model()->GetActiveWebContents();
219 } 220 }
220 if (disposition == WindowOpenDisposition::CURRENT_TAB) { 221 if (disposition == WindowOpenDisposition::CURRENT_TAB) {
221 same_tab_observer.Wait(); 222 same_tab_observer.Wait();
222 return; 223 return;
223 } else if (web_contents) { 224 } else if (web_contents) {
224 content::TestNavigationObserver observer(web_contents, 225 content::TestNavigationObserver observer(web_contents,
225 number_of_navigations); 226 number_of_navigations);
226 observer.Wait(); 227 observer.Wait();
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 if (browser != browser_) 562 if (browser != browser_)
562 return; 563 return;
563 564
564 observed_ = true; 565 observed_ = true;
565 BrowserList::RemoveObserver(this); 566 BrowserList::RemoveObserver(this);
566 if (message_loop_runner_.get() && message_loop_runner_->loop_running()) 567 if (message_loop_runner_.get() && message_loop_runner_->loop_running())
567 message_loop_runner_->Quit(); 568 message_loop_runner_->Quit();
568 } 569 }
569 570
570 } // namespace ui_test_utils 571 } // namespace ui_test_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698