Commit fc3bc4d9 authored by Nathanael Alcock's avatar Nathanael Alcock Committed by Commit Bot

Fix failing tests with password import/export on Windows.

Due to a Windows bug (https://crbug.com/177163), password import and
export tests were failing as extension subtests were not being executed.
This ensures the tests are safe even when the subtests are disabled.

Change-Id: I46093e83a539be6c49a606300fe2e3b18a8dfbb0
Reviewed-on: https://chromium-review.googlesource.com/687515Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Nathanael Alcock <varkor@google.com>
Cr-Commit-Position: refs/heads/master@{#504836}
parent b4737c69
...@@ -255,26 +255,30 @@ IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, GetPasswordExceptionList) { ...@@ -255,26 +255,30 @@ IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, GetPasswordExceptionList) {
EXPECT_TRUE(RunPasswordsSubtest("getPasswordExceptionList")) << message_; EXPECT_TRUE(RunPasswordsSubtest("getPasswordExceptionList")) << message_;
} }
#if defined(OS_WIN) IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ImportPasswords) {
#define MAYBE_ImportPasswords DISABLED_ImportPasswords
#else
#define MAYBE_ImportPasswords ImportPasswords
#endif
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, MAYBE_ImportPasswords) {
EXPECT_FALSE(importPasswordsWasTriggered()); EXPECT_FALSE(importPasswordsWasTriggered());
EXPECT_TRUE(RunPasswordsSubtest("importPasswords")) << message_; EXPECT_TRUE(RunPasswordsSubtest("importPasswords")) << message_;
EXPECT_TRUE(importPasswordsWasTriggered());
// TODO(crbug.com/177163): Extension subtests are currently skipped on
// Windows, which leads to the import passwords function never being
// triggered, causing the test to fail, so the check is currently skipped in
// this case.
if (!ExtensionApiTest::ExtensionSubtestsAreSkipped()) {
EXPECT_TRUE(importPasswordsWasTriggered());
}
} }
#if defined(OS_WIN) IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ExportPasswords) {
#define MAYBE_ExportPasswords DISABLED_ExportPasswords
#else
#define MAYBE_ExportPasswords ExportPasswords
#endif
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, MAYBE_ExportPasswords) {
EXPECT_FALSE(exportPasswordsWasTriggered()); EXPECT_FALSE(exportPasswordsWasTriggered());
EXPECT_TRUE(RunPasswordsSubtest("exportPasswords")) << message_; EXPECT_TRUE(RunPasswordsSubtest("exportPasswords")) << message_;
EXPECT_TRUE(exportPasswordsWasTriggered());
// TODO(crbug.com/177163): Extension subtests are currently skipped on
// Windows, which leads to the import passwords function never being
// triggered, causing the test to fail, so the check is currently skipped in
// this case.
if (!ExtensionApiTest::ExtensionSubtestsAreSkipped()) {
EXPECT_TRUE(exportPasswordsWasTriggered());
}
} }
} // namespace extensions } // namespace extensions
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment