| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |