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

Unified Diff: trunk/src/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc

Issue 15934004: Revert 202339 "Better workaround for extension browser test prob..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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: trunk/src/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
===================================================================
--- trunk/src/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc (revision 202346)
+++ trunk/src/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc (working copy)
@@ -106,14 +106,25 @@
host_resolver()->AddRule("www.example.com", "127.0.0.1");
ASSERT_TRUE(test_server()->Start());
ExtensionInstallUI::DisableFailureUIForTests();
+
+ ASSERT_TRUE(tmp_.CreateUniqueTempDirUnderPath(test_data_dir_));
+ ASSERT_TRUE(file_util::CreateDirectory(tmp_.path()));
+ ASSERT_TRUE(file_util::CopyDirectory(
+ test_data_dir_.AppendASCII("webstore_private"),
+ tmp_.path(),
+ true));
}
protected:
// Returns a test server URL, but with host 'www.example.com' so it matches
// the web store app's extent that we set up via command line flags.
virtual GURL GetTestServerURL(const std::string& path) {
+ std::string basename = tmp_.path().BaseName().MaybeAsASCII();
GURL url = test_server()->GetURL(
- std::string("files/extensions/api_test/webstore_private/") + path);
+ std::string("files/extensions/api_test/") +
+ basename +
+ "/webstore_private/" +
+ path);
// Replace the host with 'www.example.com' so it matches the web store
// app's extent.
@@ -127,22 +138,19 @@
// 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) {
-#if defined(OS_WIN) && !defined(NDEBUG)
- // See http://crbug.com/177163 for details.
- return true;
-#else
GURL crx_url = GetTestServerURL(crx_file);
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kAppsGalleryUpdateURL, crx_url.spec());
GURL page_url = GetTestServerURL(page);
return RunPageTest(page_url.spec());
-#endif
}
ExtensionService* service() {
return browser()->profile()->GetExtensionService();
}
+
+ base::ScopedTempDir tmp_;
};
// Test cases for webstore origin frame blocking.
@@ -222,8 +230,8 @@
ASSERT_TRUE(RunInstallTest("incorrect_manifest2.html", "extension.crx"));
}
-// Disabled: http://crbug.com/174399 and http://crbug.com/177163
-#if defined(OS_WIN) && (defined(USE_AURA) || !defined(NDEBUG))
+// Disabled: http://crbug.com/174399
+#if defined(OS_WIN) && defined(USE_AURA)
#define MAYBE_AppInstallBubble DISABLED_AppInstallBubble
#else
#define MAYBE_AppInstallBubble AppInstallBubble
@@ -252,14 +260,8 @@
ASSERT_TRUE(RunInstallTest("icon_url.html", "extension.crx"));
}
-// http://crbug.com/177163
-#if defined(OS_WIN) && !defined(NDEBUG)
-#define MAYBE_BeginInstall DISABLED_BeginInstall
-#else
-#define MAYBE_BeginInstall BeginInstall
-#endif
// Tests that the Approvals are properly created in beginInstall.
-IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, MAYBE_BeginInstall) {
+IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, BeginInstall) {
std::string appId = "iladmdjkfniedhfhcfoefgojhgaiaccc";
std::string extensionId = "enfkhcelefdadlmkffamgdlgplcionje";
ASSERT_TRUE(RunInstallTest("begin_install.html", "extension.crx"));
@@ -279,17 +281,11 @@
EXPECT_EQ(browser()->profile(), approval->profile);
}
-// http://crbug.com/177163
-#if defined(OS_WIN) && !defined(NDEBUG)
-#define MAYBE_InstallTheme DISABLED_InstallTheme
-#else
-#define MAYBE_InstallTheme InstallTheme
-#endif
// Tests that themes are installed without an install prompt.
-IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, MAYBE_InstallTheme) {
+IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallTheme) {
WebstoreInstallListener listener;
WebstorePrivateApi::SetWebstoreInstallerDelegateForTesting(&listener);
- ASSERT_TRUE(RunInstallTest("theme.html", "../../theme.crx"));
+ ASSERT_TRUE(RunInstallTest("theme.html", "../../../theme.crx"));
listener.Wait();
ASSERT_TRUE(listener.received_success());
ASSERT_EQ("iamefpfkojoapidjnbafmgkgncegbkad", listener.id());

Powered by Google App Engine
This is Rietveld 408576698