diff options
author | pavely <pavely@chromium.org> | 2015-12-11 15:26:12 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-11 23:27:00 +0000 |
commit | b7643bf88ad03846bf172205311c1b611929226f (patch) | |
tree | 17697b22db503e1043f68634e8ffa0e66300f651 | |
parent | 6467e7a0a943e70c2f91f80020bcb47b5c1c9c3a (diff) | |
download | chromium_src-b7643bf88ad03846bf172205311c1b611929226f.zip chromium_src-b7643bf88ad03846bf172205311c1b611929226f.tar.gz chromium_src-b7643bf88ad03846bf172205311c1b611929226f.tar.bz2 |
[Sync] Enable TokenServiceTableTest tests on mac
The issue I believe was that test interacts with mac keychain.
The solution is to direct test to use MockAppleKeychain instead.
R=rogerta@chromium.org
BUG=228943
Review URL: https://codereview.chromium.org/1519623002
Cr-Commit-Position: refs/heads/master@{#364832}
-rw-r--r-- | components/signin/core/browser/BUILD.gn | 1 | ||||
-rw-r--r-- | components/signin/core/browser/webdata/token_service_table_unittest.cc | 21 |
2 files changed, 8 insertions, 14 deletions
diff --git a/components/signin/core/browser/BUILD.gn b/components/signin/core/browser/BUILD.gn index f265397..b7fc113 100644 --- a/components/signin/core/browser/BUILD.gn +++ b/components/signin/core/browser/BUILD.gn @@ -144,6 +144,7 @@ source_set("unit_tests") { deps = [ ":test_support", + "//components/os_crypt:os_crypt", "//components/signin/core/common", "//testing/gmock", ] diff --git a/components/signin/core/browser/webdata/token_service_table_unittest.cc b/components/signin/core/browser/webdata/token_service_table_unittest.cc index 2540cc3..619cdb1 100644 --- a/components/signin/core/browser/webdata/token_service_table_unittest.cc +++ b/components/signin/core/browser/webdata/token_service_table_unittest.cc @@ -5,6 +5,7 @@ #include "base/files/scoped_temp_dir.h" #include "base/strings/string_number_conversions.h" #include "base/time/time.h" +#include "components/os_crypt/os_crypt.h" #include "components/signin/core/browser/webdata/token_service_table.h" #include "components/webdata/common/web_database.h" #include "testing/gtest/include/gtest/gtest.h" @@ -18,6 +19,9 @@ class TokenServiceTableTest : public testing::Test { protected: void SetUp() override { +#if defined(OS_MACOSX) + OSCrypt::UseMockKeychain(true); +#endif ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); file_ = temp_dir_.path().AppendASCII("TestWebDatabase"); @@ -35,18 +39,7 @@ class TokenServiceTableTest : public testing::Test { DISALLOW_COPY_AND_ASSIGN(TokenServiceTableTest); }; -// Flaky on mac_rel. See http://crbug.com/228943 -#if defined(OS_MACOSX) -#define MAYBE_TokenServiceGetAllRemoveAll DISABLED_TokenServiceGetAllRemoveAll -#define MAYBE_TokenServiceGetSet DISABLED_TokenServiceGetSet -#define MAYBE_TokenServiceRemove DISABLED_TokenServiceRemove -#else -#define MAYBE_TokenServiceGetAllRemoveAll TokenServiceGetAllRemoveAll -#define MAYBE_TokenServiceGetSet TokenServiceGetSet -#define MAYBE_TokenServiceRemove TokenServiceRemove -#endif - -TEST_F(TokenServiceTableTest, MAYBE_TokenServiceGetAllRemoveAll) { +TEST_F(TokenServiceTableTest, TokenServiceGetAllRemoveAll) { std::map<std::string, std::string> out_map; std::string service; std::string service2; @@ -75,7 +68,7 @@ TEST_F(TokenServiceTableTest, MAYBE_TokenServiceGetAllRemoveAll) { EXPECT_EQ("cheese", out_map.find(service)->second); } -TEST_F(TokenServiceTableTest, MAYBE_TokenServiceGetSet) { +TEST_F(TokenServiceTableTest, TokenServiceGetSet) { std::map<std::string, std::string> out_map; std::string service; service = "testservice"; @@ -100,7 +93,7 @@ TEST_F(TokenServiceTableTest, MAYBE_TokenServiceGetSet) { EXPECT_EQ("ham", out_map.find(service)->second); } -TEST_F(TokenServiceTableTest, MAYBE_TokenServiceRemove) { +TEST_F(TokenServiceTableTest, TokenServiceRemove) { std::map<std::string, std::string> out_map; std::string service; std::string service2; |