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

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

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

Powered by Google App Engine
This is Rietveld 408576698