Index: chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc |
diff --git a/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc b/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc |
index 7a1fd37f61d96deb57589e92f5cf999179fc8b4d..f4ac37771861c22b47387a8b425423bbeebede2d 100644 |
--- a/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc |
+++ b/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc |
@@ -10,13 +10,15 @@ |
#include "components/signin/core/common/profile_management_switches.h" |
#include "content/public/browser/notification_service.h" |
#include "extensions/browser/api/test/test_api.h" |
+#include "extensions/common/switches.h" |
namespace extensions { |
namespace { |
-const char kTestUser[] = "testuser@gmail.com"; |
const char kAttemptClickAuthMessage[] = "attemptClickAuth"; |
+const char kTestExtensionId[] = "lkegkdgachcnekllcdfkijonogckdnjo"; |
+const char kTestUser[] = "testuser@gmail.com"; |
} // namespace |
@@ -30,10 +32,12 @@ class ScreenlockPrivateApiTest : public ExtensionApiTest, |
// ExtensionApiTest |
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
ExtensionApiTest::SetUpCommandLine(command_line); |
+ command_line->AppendSwitchASCII( |
+ extensions::switches::kWhitelistedExtensionID, kTestExtensionId); |
#if !defined(OS_CHROMEOS) |
// New profile management needs to be on for non-ChromeOS lock. |
- switches::EnableNewProfileManagementForTesting(command_line); |
+ ::switches::EnableNewProfileManagementForTesting(command_line); |
#endif |
} |
@@ -67,6 +71,16 @@ class ScreenlockPrivateApiTest : public ExtensionApiTest, |
} |
} |
+ // Loads |extension_name| as appropriate for the platform and waits for a |
+ // pass / fail notification. |
+ void RunTest(const std::string& extension_name) { |
+#if defined(OS_CHROMEOS) |
+ ASSERT_TRUE(RunComponentExtensionTest(extension_name)) << message_; |
+#else |
+ ASSERT_TRUE(RunExtensionTest(extension_name)) << message_; |
+#endif |
+ } |
+ |
private: |
content::NotificationRegistrar registrar_; |
@@ -74,11 +88,11 @@ class ScreenlockPrivateApiTest : public ExtensionApiTest, |
}; |
IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, LockUnlock) { |
- ASSERT_TRUE(RunExtensionTest("screenlock_private/lock_unlock")) << message_; |
+ RunTest("screenlock_private/lock_unlock"); |
} |
IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { |
- ASSERT_TRUE(RunExtensionTest("screenlock_private/auth_type")) << message_; |
+ RunTest("screenlock_private/auth_type"); |
} |
} // namespace extensions |