diff options
| author | rdevlin.cronin <rdevlin.cronin@chromium.org> | 2016-03-23 17:02:29 -0700 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2016-03-24 00:03:51 +0000 |
| commit | 4a78c48bcf51dda7cb915ba1866fdefcffa9bc0c (patch) | |
| tree | 1506b62bbcd37454d87a78d7bb55fb36518834eb /chrome/browser/extensions/extension_action_runner_unittest.cc | |
| parent | de73d1be8f921f7155a606a558452b5f89c48fb2 (diff) | |
| download | chromium_src-4a78c48bcf51dda7cb915ba1866fdefcffa9bc0c.zip chromium_src-4a78c48bcf51dda7cb915ba1866fdefcffa9bc0c.tar.gz chromium_src-4a78c48bcf51dda7cb915ba1866fdefcffa9bc0c.tar.bz2 | |
[Extensions] Show a "refresh" bubble when needed with click-to-script
When an extension wants to inject scripts at document start or use webRequest,
it needs to act on the page before the page completes loading. This is a problem
with click-to-script, which makes extensions wait for user action. For now,
add a bubble that prompts the user to refresh the page in order to allow the
extension to run on the page if the user triggers it and it had blocked actions
that need to run at document_start.
BUG=460306
Review URL: https://codereview.chromium.org/1809813002
Cr-Commit-Position: refs/heads/master@{#382981}
Diffstat (limited to 'chrome/browser/extensions/extension_action_runner_unittest.cc')
| -rw-r--r-- | chrome/browser/extensions/extension_action_runner_unittest.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extension_action_runner_unittest.cc b/chrome/browser/extensions/extension_action_runner_unittest.cc index 2aaff8c..edacb84 100644 --- a/chrome/browser/extensions/extension_action_runner_unittest.cc +++ b/chrome/browser/extensions/extension_action_runner_unittest.cc @@ -209,7 +209,7 @@ TEST_F(ExtensionActionRunnerUnitTest, RequestPermissionAndExecute) { EXPECT_EQ(0u, GetExecutionCountForExtension(extension->id())); // Click to accept the extension executing. - runner()->RunAction(extension, true); + runner()->RunForTesting(extension); // The extension should execute, and the extension shouldn't want to run. EXPECT_EQ(1u, GetExecutionCountForExtension(extension->id())); @@ -234,7 +234,7 @@ TEST_F(ExtensionActionRunnerUnitTest, RequestPermissionAndExecute) { // Grant access. RequestInjection(extension); - runner()->RunAction(extension, true); + runner()->RunForTesting(extension); EXPECT_EQ(2u, GetExecutionCountForExtension(extension->id())); EXPECT_FALSE(runner()->WantsToRun(extension)); @@ -266,7 +266,7 @@ TEST_F(ExtensionActionRunnerUnitTest, PendingInjectionsRemovedAtNavigation) { // Request and accept a new injection. RequestInjection(extension); - runner()->RunAction(extension, true); + runner()->RunForTesting(extension); // The extension should only have executed once, even though a grand total // of two executions were requested. @@ -290,7 +290,7 @@ TEST_F(ExtensionActionRunnerUnitTest, MultiplePendingInjection) { EXPECT_EQ(0u, GetExecutionCountForExtension(extension->id())); - runner()->RunAction(extension, true); + runner()->RunForTesting(extension); // All pending injections should have executed. EXPECT_EQ(kNumInjections, GetExecutionCountForExtension(extension->id())); @@ -388,7 +388,7 @@ TEST_F(ExtensionActionRunnerUnitTest, TestAlwaysRun) { // Allow the extension to always run on this origin. ScriptingPermissionsModifier modifier(profile(), extension); modifier.GrantHostPermission(web_contents()->GetLastCommittedURL()); - runner()->RunAction(extension, true); + runner()->RunForTesting(extension); // The extension should execute, and the extension shouldn't want to run. EXPECT_EQ(1u, GetExecutionCountForExtension(extension->id())); @@ -444,7 +444,7 @@ TEST_F(ExtensionActionRunnerUnitTest, TestDifferentScriptRunLocations) { EXPECT_EQ(BLOCKED_ACTION_SCRIPT_AT_START | BLOCKED_ACTION_SCRIPT_OTHER, runner()->GetBlockedActions(extension)); - runner()->RunAction(extension, true); + runner()->RunForTesting(extension); EXPECT_EQ(BLOCKED_ACTION_NONE, runner()->GetBlockedActions(extension)); } |
