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

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

Issue 6992047: Change the web store private install API to accept a localized extension name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased, removed test files I added in separate CL Created 9 years, 7 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/extension_webstore_private_apitest.cc
diff --git a/chrome/browser/extensions/extension_webstore_private_apitest.cc b/chrome/browser/extensions/extension_webstore_private_apitest.cc
index cdd465e8754ce42a255104af55b1086954e5b625..2638beb65786ded0e61334bfc110e236a5debd19 100644
--- a/chrome/browser/extensions/extension_webstore_private_apitest.cc
+++ b/chrome/browser/extensions/extension_webstore_private_apitest.cc
@@ -51,9 +51,10 @@ class ExtensionWebstorePrivateApiTest : public ExtensionApiTest {
return url.ReplaceComponents(replace_host);
}
- // Navigates to |page| and runs the Extension API test there.
- bool RunInstallTest(const std::string& page) {
- GURL crx_url = GetTestServerURL("extension.crx");
+ // Navigates to |page| and runs the Extension API test there. Any downloads
+ // of extensions will return the contents of |crx_file|.
+ bool RunInstallTest(const std::string& page, const std::string& crx_file) {
+ GURL crx_url = GetTestServerURL(crx_file);
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kAppsGalleryUpdateURL, crx_url.spec());
@@ -69,18 +70,23 @@ class ExtensionWebstorePrivateApiTest : public ExtensionApiTest {
// TODO(asargent) - flaky; see crbug.com/80606.
// Test cases where the user accepts the install confirmation dialog.
IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, FLAKY_InstallAccepted) {
- ASSERT_TRUE(RunInstallTest("accepted.html"));
+ ASSERT_TRUE(RunInstallTest("accepted.html", "extension.crx"));
+}
+
+// Tests passing a localized name.
+IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallLocalized) {
+ ASSERT_TRUE(RunInstallTest("localized.html", "localized_extension.crx"));
}
// Now test the case where the user cancels the confirmation dialog.
IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallCancelled) {
BeginInstallWithManifestFunction::SetAutoConfirmForTests(false);
- ASSERT_TRUE(RunInstallTest("cancelled.html"));
+ ASSERT_TRUE(RunInstallTest("cancelled.html", "extension.crx"));
}
IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallNoGesture) {
BeginInstallFunction::SetIgnoreUserGestureForTests(false);
- ASSERT_TRUE(RunInstallTest("no_user_gesture.html"));
+ ASSERT_TRUE(RunInstallTest("no_user_gesture.html", "extension.crx"));
}
IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest,
@@ -88,7 +94,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest,
ui_test_utils::WindowedNotificationObserver observer(
NotificationType::EXTENSION_INSTALL_ERROR,
NotificationService::AllSources());
- ASSERT_TRUE(RunInstallTest("incorrect_manifest1.html"));
+ ASSERT_TRUE(RunInstallTest("incorrect_manifest1.html", "extension.crx"));
observer.Wait();
}
@@ -97,6 +103,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest,
ui_test_utils::WindowedNotificationObserver observer(
NotificationType::EXTENSION_INSTALL_ERROR,
NotificationService::AllSources());
- ASSERT_TRUE(RunInstallTest("incorrect_manifest2.html"));
+ ASSERT_TRUE(RunInstallTest("incorrect_manifest2.html", "extension.crx"));
observer.Wait();
}
« no previous file with comments | « chrome/browser/extensions/extension_webstore_private_api.cc ('k') | chrome/browser/extensions/sandboxed_extension_unpacker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698