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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 virtual void TearDown() OVERRIDE { | 187 virtual void TearDown() OVERRIDE { |
188 frontend_.reset(); | 188 frontend_.reset(); |
189 profile_.reset(); | 189 profile_.reset(); |
190 } | 190 } |
191 | 191 |
192 protected: | 192 protected: |
193 // Adds a record of an extension or app to the extension service, then returns | 193 // Adds a record of an extension or app to the extension service, then returns |
194 // its storage area. | 194 // its storage area. |
195 SettingsStorage* AddExtensionAndGetStorage( | 195 SettingsStorage* AddExtensionAndGetStorage( |
196 const std::string& id, Extension::Type type) { | 196 const std::string& id, Extension::Type type) { |
197 profile_->GetMockExtensionService()->AddExtension(id, type); | 197 profile_->GetMockExtensionService()->AddExtensionWithId(id, type); |
198 return GetStorage(id, frontend_.get()); | 198 return GetStorage(id, frontend_.get()); |
199 } | 199 } |
200 | 200 |
201 // Gets the SyncableService for the given sync type. | 201 // Gets the SyncableService for the given sync type. |
202 SyncableService* GetSyncableService(syncable::ModelType model_type) { | 202 SyncableService* GetSyncableService(syncable::ModelType model_type) { |
203 SyncableService* settings_service = NULL; | 203 SyncableService* settings_service = NULL; |
204 frontend_->RunWithSyncableService( | 204 frontend_->RunWithSyncableService( |
205 model_type, base::Bind(&AssignSettingsService, &settings_service)); | 205 model_type, base::Bind(&AssignSettingsService, &settings_service)); |
206 MessageLoop::current()->RunAllPending(); | 206 MessageLoop::current()->RunAllPending(); |
207 return settings_service; | 207 return settings_service; |
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 EXPECT_EQ( | 1240 EXPECT_EQ( |
1241 SyncChange::ACTION_UPDATE, | 1241 SyncChange::ACTION_UPDATE, |
1242 sync_.GetOnlyChange("good", "foo").change_type()); | 1242 sync_.GetOnlyChange("good", "foo").change_type()); |
1243 EXPECT_EQ( | 1243 EXPECT_EQ( |
1244 SyncChange::ACTION_UPDATE, | 1244 SyncChange::ACTION_UPDATE, |
1245 sync_.GetOnlyChange("good", "foo").change_type()); | 1245 sync_.GetOnlyChange("good", "foo").change_type()); |
1246 EXPECT_EQ(2u, sync_.changes().size()); | 1246 EXPECT_EQ(2u, sync_.changes().size()); |
1247 } | 1247 } |
1248 | 1248 |
1249 } // namespace extensions | 1249 } // namespace extensions |
OLD | NEW |