| 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 "chrome/browser/supervised_user/supervised_user_resource_throttle.h" | 5 #include "chrome/browser/supervised_user/supervised_user_resource_throttle.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // Both iframes (from allowed host iframe1.com as well as from blocked host | 130 // Both iframes (from allowed host iframe1.com as well as from blocked host |
| 131 // iframe2.com) should be loaded normally, since we don't filter iframes | 131 // iframe2.com) should be loaded normally, since we don't filter iframes |
| 132 // (yet) - see crbug.com/651115. | 132 // (yet) - see crbug.com/651115. |
| 133 bool loaded1 = false; | 133 bool loaded1 = false; |
| 134 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(tab, "loaded1()", &loaded1)); | 134 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(tab, "loaded1()", &loaded1)); |
| 135 EXPECT_TRUE(loaded1); | 135 EXPECT_TRUE(loaded1); |
| 136 bool loaded2 = false; | 136 bool loaded2 = false; |
| 137 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(tab, "loaded2()", &loaded2)); | 137 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(tab, "loaded2()", &loaded2)); |
| 138 EXPECT_TRUE(loaded2); | 138 EXPECT_TRUE(loaded2); |
| 139 } | 139 } |
| 140 |
| 141 class SupervisedUserResourceThrottleNotSupervisedTest |
| 142 : public SupervisedUserResourceThrottleTest { |
| 143 protected: |
| 144 SupervisedUserResourceThrottleNotSupervisedTest() {} |
| 145 ~SupervisedUserResourceThrottleNotSupervisedTest() override {} |
| 146 |
| 147 private: |
| 148 // Overridden to do nothing, so that the supervised user ID will be empty. |
| 149 void SetUpCommandLine(base::CommandLine* command_line) override {} |
| 150 }; |
| 151 |
| 152 IN_PROC_BROWSER_TEST_F(SupervisedUserResourceThrottleNotSupervisedTest, |
| 153 DontBlock) { |
| 154 BlockHost(kExampleHost); |
| 155 |
| 156 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
| 157 |
| 158 GURL blocked_url = embedded_test_server()->GetURL( |
| 159 kExampleHost, "/supervised_user/simple.html"); |
| 160 ui_test_utils::NavigateToURL(browser(), blocked_url); |
| 161 // Even though the URL is marked as blocked, the load should go through, since |
| 162 // the user isn't supervised. |
| 163 EXPECT_FALSE(tab->ShowingInterstitialPage()); |
| 164 } |
| OLD | NEW |