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

Unified Diff: chrome/browser/extensions/webstore_installer_test.cc

Issue 2655823002: Include referrer chain with inline install requests. (Closed)
Patch Set: cleanup Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/webstore_installer_test.cc
diff --git a/chrome/browser/extensions/webstore_installer_test.cc b/chrome/browser/extensions/webstore_installer_test.cc
index 1cd03980c2267557a2b8cdb6050e2d703143fad0..2131abfc3ffd648e037f158ab7d3b7328f6e09ef 100644
--- a/chrome/browser/extensions/webstore_installer_test.cc
+++ b/chrome/browser/extensions/webstore_installer_test.cc
@@ -37,6 +37,8 @@ using extensions::WebstoreInlineInstaller;
using extensions::WebstoreInlineInstallerFactory;
using extensions::WebstoreStandaloneInstaller;
+using net::test_server::HttpRequest;
+
WebstoreInstallerTest::WebstoreInstallerTest(
const std::string& webstore_domain,
const std::string& test_data_path,
@@ -54,6 +56,9 @@ WebstoreInstallerTest::~WebstoreInstallerTest() {}
void WebstoreInstallerTest::SetUpCommandLine(base::CommandLine* command_line) {
ExtensionBrowserTest::SetUpCommandLine(command_line);
+
+ embedded_test_server()->RegisterRequestMonitor(base::Bind(
+ &WebstoreInstallerTest::MonitorServerRequest, base::Unretained(this)));
Devlin 2017/01/27 20:31:34 Why not bind to ProcessServerRequest directly?
robertshield 2017/01/28 03:58:48 Hrmm.. I think I had MonitorServerRequest doing so
// We start the test server now instead of in
// SetUpInProcessBrowserTestFixture so that we can get its port number.
ASSERT_TRUE(embedded_test_server()->Start());
@@ -88,6 +93,10 @@ void WebstoreInstallerTest::SetUpOnMainThread() {
download_prefs->SetDownloadPath(download_directory_.GetPath());
}
+void WebstoreInstallerTest::MonitorServerRequest(const HttpRequest& request) {
+ ProcessServerRequest(request);
+}
+
GURL WebstoreInstallerTest::GenerateTestServerUrl(
const std::string& domain,
const std::string& page_filename) {
@@ -137,6 +146,8 @@ void WebstoreInstallerTest::RunTestAsync(
ExecuteJavaScriptWithUserGestureForTests(base::UTF8ToUTF16(script));
}
+void WebstoreInstallerTest::ProcessServerRequest(const HttpRequest& request) {}
+
void WebstoreInstallerTest::AutoAcceptInstall() {
install_auto_confirm_.reset(); // Destroy any old override first.
install_auto_confirm_.reset(new extensions::ScopedTestDialogAutoConfirm(

Powered by Google App Engine
This is Rietveld 408576698