Introduce NavigationSimulator::Reload
This CL introduces new methods to simulate reloads in
NavigationSimulator. It replaces usage of
RenderViewHostTestHarness::Reload and
RenderViewHostTestHarness::FailedReload by these new methods.
BUG=728571
Change-Id: I246f86d357878d43e6cab155b6be8a100028686a
Reviewed-on: https://chromium-review.googlesource.com/624028
Commit-Queue: Camille Lamy <[email protected]>
Reviewed-by: Devlin <[email protected]>
Reviewed-by: David Trainor <[email protected]>
Reviewed-by: Takashi Toyoshima <[email protected]>
Reviewed-by: Bernhard Bauer <[email protected]>
Reviewed-by: Tim Volodine <[email protected]>
Reviewed-by: Nasko Oskov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#510452}
diff --git a/chrome/browser/extensions/extension_action_runner_unittest.cc b/chrome/browser/extensions/extension_action_runner_unittest.cc
index d1cc58f..0be4201 100644
--- a/chrome/browser/extensions/extension_action_runner_unittest.cc
+++ b/chrome/browser/extensions/extension_action_runner_unittest.cc
@@ -21,6 +21,7 @@
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/test/navigation_simulator.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
@@ -220,7 +221,7 @@
// Reloading and same-origin navigations shouldn't clear those permissions,
// and we shouldn't require user constent again.
- Reload();
+ content::NavigationSimulator::Reload(web_contents());
EXPECT_FALSE(RequiresUserConsent(extension));
NavigateAndCommit(GURL("https://www.google.com/foo"));
EXPECT_FALSE(RequiresUserConsent(extension));
@@ -259,7 +260,7 @@
// Reload. This should remove the pending injection, and we should not
// execute anything.
- Reload();
+ content::NavigationSimulator::Reload(web_contents());
EXPECT_FALSE(runner()->WantsToRun(extension));
EXPECT_EQ(0u, GetExecutionCountForExtension(extension->id()));
@@ -314,7 +315,7 @@
// Reloading and other same-origin navigations maintain the permission to
// execute.
- Reload();
+ content::NavigationSimulator::Reload(web_contents());
EXPECT_FALSE(RequiresUserConsent(extension));
NavigateAndCommit(GURL("https://www.google.com/foo"));
EXPECT_FALSE(RequiresUserConsent(extension));
@@ -409,7 +410,7 @@
// Reloading the extension should not clear any granted host permissions.
extension = ReloadExtension();
- Reload();
+ content::NavigationSimulator::Reload(web_contents());
EXPECT_FALSE(RequiresUserConsent(extension));
// Different host...