OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 EXPECT_EQ(1u, pm->GetRenderFrameHostsForExtension(extension->id()).size()); | 1116 EXPECT_EQ(1u, pm->GetRenderFrameHostsForExtension(extension->id()).size()); |
1117 EXPECT_EQ(1u, pm->GetAllFrames().size()); | 1117 EXPECT_EQ(1u, pm->GetAllFrames().size()); |
1118 } | 1118 } |
1119 | 1119 |
1120 // Verify that the blocking was recorded correctly in UMA. | 1120 // Verify that the blocking was recorded correctly in UMA. |
1121 uma.ExpectTotalCount("Extensions.ShouldAllowOpenURL.Failure", 2); | 1121 uma.ExpectTotalCount("Extensions.ShouldAllowOpenURL.Failure", 2); |
1122 uma.ExpectBucketCount("Extensions.ShouldAllowOpenURL.Failure", | 1122 uma.ExpectBucketCount("Extensions.ShouldAllowOpenURL.Failure", |
1123 0 /* FAILURE_FILE_SYSTEM_URL */, 1); | 1123 0 /* FAILURE_FILE_SYSTEM_URL */, 1); |
1124 uma.ExpectBucketCount("Extensions.ShouldAllowOpenURL.Failure", | 1124 uma.ExpectBucketCount("Extensions.ShouldAllowOpenURL.Failure", |
1125 1 /* FAILURE_BLOB_URL */, 1); | 1125 1 /* FAILURE_BLOB_URL */, 1); |
| 1126 uma.ExpectUniqueSample("Extensions.ShouldAllowOpenURL.Failure.Scheme", |
| 1127 2 /* SCHEME_HTTP */, 2); |
1126 } | 1128 } |
1127 | 1129 |
1128 // Verify that a web popup created via window.open from an extension page can | 1130 // Verify that a web popup created via window.open from an extension page can |
1129 // communicate with the extension page via window.opener. See | 1131 // communicate with the extension page via window.opener. See |
1130 // https://crbug.com/590068. | 1132 // https://crbug.com/590068. |
1131 IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, | 1133 IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, |
1132 WebPopupFromExtensionMainFrameHasValidOpener) { | 1134 WebPopupFromExtensionMainFrameHasValidOpener) { |
1133 // Create a simple extension without a background page. | 1135 // Create a simple extension without a background page. |
1134 const Extension* extension = CreateExtension("Extension", false); | 1136 const Extension* extension = CreateExtension("Extension", false); |
1135 embedded_test_server()->ServeFilesFromDirectory(extension->path()); | 1137 embedded_test_server()->ServeFilesFromDirectory(extension->path()); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 EXPECT_TRUE(ExecuteScriptAndExtractBool( | 1214 EXPECT_TRUE(ExecuteScriptAndExtractBool( |
1213 popup, "window.domAutomationController.send(!!window.opener)", | 1215 popup, "window.domAutomationController.send(!!window.opener)", |
1214 &is_opener_defined)); | 1216 &is_opener_defined)); |
1215 EXPECT_TRUE(is_opener_defined); | 1217 EXPECT_TRUE(is_opener_defined); |
1216 | 1218 |
1217 // Verify that postMessage to window.opener works. | 1219 // Verify that postMessage to window.opener works. |
1218 VerifyPostMessageToOpener(popup->GetMainFrame(), extension_frame); | 1220 VerifyPostMessageToOpener(popup->GetMainFrame(), extension_frame); |
1219 } | 1221 } |
1220 | 1222 |
1221 } // namespace extensions | 1223 } // namespace extensions |
OLD | NEW |