| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/rand_util.h" | 5 #include "base/rand_util.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 8 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 const char kGenericURLTitle[] = "URL Title"; | 57 const char kGenericURLTitle[] = "URL Title"; |
| 58 const char kGenericFolderName[] = "Folder Name"; | 58 const char kGenericFolderName[] = "Folder Name"; |
| 59 const char kGenericSubfolderName[] = "Subfolder Name"; | 59 const char kGenericSubfolderName[] = "Subfolder Name"; |
| 60 const char kValidPassphrase[] = "passphrase!"; | 60 const char kValidPassphrase[] = "passphrase!"; |
| 61 | 61 |
| 62 } // namespace | 62 } // namespace |
| 63 | 63 |
| 64 class TwoClientBookmarksSyncTest : public SyncTest { | 64 class TwoClientBookmarksSyncTest : public SyncTest { |
| 65 public: | 65 public: |
| 66 TwoClientBookmarksSyncTest() : SyncTest(TWO_CLIENT) {} | 66 TwoClientBookmarksSyncTest() : SyncTest(TWO_CLIENT) {} |
| 67 virtual ~TwoClientBookmarksSyncTest() {} | 67 ~TwoClientBookmarksSyncTest() override {} |
| 68 | 68 |
| 69 void TearDownInProcessBrowserTestFixture() override { | 69 void TearDownInProcessBrowserTestFixture() override { |
| 70 SyncTest::TearDownInProcessBrowserTestFixture(); | 70 SyncTest::TearDownInProcessBrowserTestFixture(); |
| 71 policy_provider_.Shutdown(); | 71 policy_provider_.Shutdown(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 protected: | 74 protected: |
| 75 // Needs to be deleted after all Profiles are deleted. | 75 // Needs to be deleted after all Profiles are deleted. |
| 76 policy::MockConfigurationPolicyProvider policy_provider_; | 76 policy::MockConfigurationPolicyProvider policy_provider_; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 DISALLOW_COPY_AND_ASSIGN(TwoClientBookmarksSyncTest); | 79 DISALLOW_COPY_AND_ASSIGN(TwoClientBookmarksSyncTest); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 class LegacyTwoClientBookmarksSyncTest : public SyncTest { | 82 class LegacyTwoClientBookmarksSyncTest : public SyncTest { |
| 83 public: | 83 public: |
| 84 LegacyTwoClientBookmarksSyncTest() : SyncTest(TWO_CLIENT_LEGACY) {} | 84 LegacyTwoClientBookmarksSyncTest() : SyncTest(TWO_CLIENT_LEGACY) {} |
| 85 virtual ~LegacyTwoClientBookmarksSyncTest() {} | 85 ~LegacyTwoClientBookmarksSyncTest() override {} |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 DISALLOW_COPY_AND_ASSIGN(LegacyTwoClientBookmarksSyncTest); | 88 DISALLOW_COPY_AND_ASSIGN(LegacyTwoClientBookmarksSyncTest); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, Sanity) { | 91 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, Sanity) { |
| 92 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 92 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 93 ASSERT_TRUE(AllModelsMatchVerifier()); | 93 ASSERT_TRUE(AllModelsMatchVerifier()); |
| 94 | 94 |
| 95 GURL google_url("http://www.google.com"); | 95 GURL google_url("http://www.google.com"); |
| (...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2124 | 2124 |
| 2125 // Verify that the managed bookmark exists in the local model of the first | 2125 // Verify that the managed bookmark exists in the local model of the first |
| 2126 // Profile, and has a child node. | 2126 // Profile, and has a child node. |
| 2127 ASSERT_EQ(1, managed_node0->child_count()); | 2127 ASSERT_EQ(1, managed_node0->child_count()); |
| 2128 ASSERT_TRUE(managed_node0->IsVisible()); | 2128 ASSERT_TRUE(managed_node0->IsVisible()); |
| 2129 EXPECT_EQ(GURL("http://youtube.com/"), managed_node0->GetChild(0)->url()); | 2129 EXPECT_EQ(GURL("http://youtube.com/"), managed_node0->GetChild(0)->url()); |
| 2130 | 2130 |
| 2131 // Verify that the second Profile didn't get this node. | 2131 // Verify that the second Profile didn't get this node. |
| 2132 ASSERT_EQ(0, managed_node1->child_count()); | 2132 ASSERT_EQ(0, managed_node1->child_count()); |
| 2133 } | 2133 } |
| OLD | NEW |