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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_apitest.cc

Issue 2013573007: Catch CSP violations in InProcessBrowserTest Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: double check test is run Created 4 years, 4 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 (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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestComplex) { 151 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestComplex) {
152 ASSERT_TRUE(StartEmbeddedTestServer()); 152 ASSERT_TRUE(StartEmbeddedTestServer());
153 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_complex.html")) << 153 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_complex.html")) <<
154 message_; 154 message_;
155 } 155 }
156 156
157 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestTypes) { 157 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestTypes) {
158 ASSERT_TRUE(StartEmbeddedTestServer()); 158 ASSERT_TRUE(StartEmbeddedTestServer());
159 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_types.html")) << message_; 159 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_types.html")) << message_;
160 // The violation is not intentional. See crbug.com/616181
161 SetExpectCSPErrorMessages(true);
160 } 162 }
161 163
162 // Test that the webRequest events are dispatched with the expected details when 164 // Test that the webRequest events are dispatched with the expected details when
163 // a frame or tab is removed while a response is being received. 165 // a frame or tab is removed while a response is being received.
164 // Flaky: https://crbug.com/617865 166 // Flaky: https://crbug.com/617865
165 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, 167 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
166 DISABLED_WebRequestUnloadAfterRequest) { 168 DISABLED_WebRequestUnloadAfterRequest) {
167 ASSERT_TRUE(StartEmbeddedTestServer()); 169 ASSERT_TRUE(StartEmbeddedTestServer());
168 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_unload.html?1")) << 170 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_unload.html?1")) <<
169 message_; 171 message_;
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 ASSERT_TRUE(granter); 574 ASSERT_TRUE(granter);
573 granter->RevokeForTesting(); 575 granter->RevokeForTesting();
574 base::RunLoop().RunUntilIdle(); 576 base::RunLoop().RunUntilIdle();
575 PerformXhrInPage(web_contents, kHost, port, kXhrPath); 577 PerformXhrInPage(web_contents, kHost, port, kXhrPath);
576 EXPECT_EQ(xhr_count, 578 EXPECT_EQ(xhr_count,
577 GetWebRequestCountFromBackgroundPage(extension, profile())); 579 GetWebRequestCountFromBackgroundPage(extension, profile()));
578 EXPECT_EQ(BLOCKED_ACTION_WEB_REQUEST, runner->GetBlockedActions(extension)); 580 EXPECT_EQ(BLOCKED_ACTION_WEB_REQUEST, runner->GetBlockedActions(extension));
579 } 581 }
580 582
581 } // namespace extensions 583 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698