OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/test/live_sync/sync_extension_helper.h" | 5 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
12 #include "chrome/browser/extensions/pending_extension_info.h" | 12 #include "chrome/browser/extensions/pending_extension_info.h" |
13 #include "chrome/browser/extensions/pending_extension_manager.h" | 13 #include "chrome/browser/extensions/pending_extension_manager.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/common/extensions/extension_constants.h" | 15 #include "chrome/common/extensions/extension_constants.h" |
16 #include "chrome/browser/sync/test/live_sync/live_sync_test.h" | 16 #include "chrome/browser/sync/test/integration/sync_test.h" |
17 #include "chrome/browser/sync/test/live_sync/sync_datatype_helper.h" | 17 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 SyncExtensionHelper::ExtensionState::ExtensionState() | 20 SyncExtensionHelper::ExtensionState::ExtensionState() |
21 : enabled_state(ENABLED), incognito_enabled(false) {} | 21 : enabled_state(ENABLED), incognito_enabled(false) {} |
22 | 22 |
23 SyncExtensionHelper::ExtensionState::~ExtensionState() {} | 23 SyncExtensionHelper::ExtensionState::~ExtensionState() {} |
24 | 24 |
25 bool SyncExtensionHelper::ExtensionState::Equals( | 25 bool SyncExtensionHelper::ExtensionState::Equals( |
26 const SyncExtensionHelper::ExtensionState &other) const { | 26 const SyncExtensionHelper::ExtensionState &other) const { |
27 return ((enabled_state == other.enabled_state) && | 27 return ((enabled_state == other.enabled_state) && |
(...skipping 11 matching lines...) Expand all Loading... |
39 | 39 |
40 SyncExtensionHelper::~SyncExtensionHelper() {} | 40 SyncExtensionHelper::~SyncExtensionHelper() {} |
41 | 41 |
42 // static | 42 // static |
43 std::string SyncExtensionHelper::NameToId(const std::string& name) { | 43 std::string SyncExtensionHelper::NameToId(const std::string& name) { |
44 std::string id; | 44 std::string id; |
45 EXPECT_TRUE(Extension::GenerateId(name, &id)); | 45 EXPECT_TRUE(Extension::GenerateId(name, &id)); |
46 return id; | 46 return id; |
47 } | 47 } |
48 | 48 |
49 void SyncExtensionHelper::SetupIfNecessary(LiveSyncTest* test) { | 49 void SyncExtensionHelper::SetupIfNecessary(SyncTest* test) { |
50 if (setup_completed_) | 50 if (setup_completed_) |
51 return; | 51 return; |
52 | 52 |
53 for (int i = 0; i < test->num_clients(); ++i) { | 53 for (int i = 0; i < test->num_clients(); ++i) { |
54 SetupProfile(test->GetProfile(i)); | 54 SetupProfile(test->GetProfile(i)); |
55 } | 55 } |
56 SetupProfile(test->verifier()); | 56 SetupProfile(test->verifier()); |
57 | 57 |
58 setup_completed_ = true; | 58 setup_completed_ = true; |
59 } | 59 } |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 if (extension->id() != expected_id) { | 352 if (extension->id() != expected_id) { |
353 EXPECT_EQ(expected_id, extension->id()); | 353 EXPECT_EQ(expected_id, extension->id()); |
354 return NULL; | 354 return NULL; |
355 } | 355 } |
356 VLOG(2) << "created extension with name = " | 356 VLOG(2) << "created extension with name = " |
357 << name << ", id = " << expected_id; | 357 << name << ", id = " << expected_id; |
358 (it->second)[name] = extension; | 358 (it->second)[name] = extension; |
359 id_to_name_[expected_id] = name; | 359 id_to_name_[expected_id] = name; |
360 return extension; | 360 return extension; |
361 } | 361 } |
OLD | NEW |