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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_browsertest.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <utility> 5 #include <utility>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 // Navigates to a blocked URL in a new tab. We expect the tab to be closed 200 // Navigates to a blocked URL in a new tab. We expect the tab to be closed
201 // automatically on pressing the "back" button on the interstitial. 201 // automatically on pressing the "back" button on the interstitial.
202 IN_PROC_BROWSER_TEST_F(SupervisedUserBlockModeTest, OpenBlockedURLInNewTab) { 202 IN_PROC_BROWSER_TEST_F(SupervisedUserBlockModeTest, OpenBlockedURLInNewTab) {
203 TabStripModel* tab_strip = browser()->tab_strip_model(); 203 TabStripModel* tab_strip = browser()->tab_strip_model();
204 WebContents* prev_tab = tab_strip->GetActiveWebContents(); 204 WebContents* prev_tab = tab_strip->GetActiveWebContents();
205 205
206 // Open blocked URL in a new tab. 206 // Open blocked URL in a new tab.
207 GURL test_url("http://www.example.com/simple.html"); 207 GURL test_url("http://www.example.com/simple.html");
208 ui_test_utils::NavigateToURLWithDisposition( 208 ui_test_utils::NavigateToURLWithDisposition(
209 browser(), test_url, NEW_FOREGROUND_TAB, 209 browser(), test_url, WindowOpenDisposition::NEW_FOREGROUND_TAB,
210 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 210 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
211 211
212 // Check that we got the interstitial. 212 // Check that we got the interstitial.
213 WebContents* tab = tab_strip->GetActiveWebContents(); 213 WebContents* tab = tab_strip->GetActiveWebContents();
214 CheckShownPageIsInterstitial(tab); 214 CheckShownPageIsInterstitial(tab);
215 215
216 // On pressing the "back" button, the new tab should be closed, and we should 216 // On pressing the "back" button, the new tab should be closed, and we should
217 // get back to the previous active tab. 217 // get back to the previous active tab.
218 MockTabStripModelObserver observer(tab_strip); 218 MockTabStripModelObserver observer(tab_strip);
219 base::RunLoop run_loop; 219 base::RunLoop run_loop;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 scoped_refptr<SupervisedUserURLFilter> filter = 310 scoped_refptr<SupervisedUserURLFilter> filter =
311 supervised_user_service_->GetURLFilterForUIThread(); 311 supervised_user_service_->GetURLFilterForUIThread();
312 EXPECT_EQ(SupervisedUserURLFilter::ALLOW, 312 EXPECT_EQ(SupervisedUserURLFilter::ALLOW,
313 filter->GetFilteringBehaviorForURL(test_url.GetWithEmptyPath())); 313 filter->GetFilteringBehaviorForURL(test_url.GetWithEmptyPath()));
314 314
315 observer.Wait(); 315 observer.Wait();
316 EXPECT_EQ(test_url, web_contents->GetURL()); 316 EXPECT_EQ(test_url, web_contents->GetURL());
317 } 317 }
318 318
319 } // namespace 319 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698