OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/api/sessions/sessions_api.h" | 5 #include "chrome/browser/extensions/api/sessions/sessions_api.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/extensions/api/tabs/tabs_api.h" | 10 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 EXPECT_CALL(*service, GetAuthError()).WillRepeatedly( | 141 EXPECT_CALL(*service, GetAuthError()).WillRepeatedly( |
142 testing::ReturnRef(no_error)); | 142 testing::ReturnRef(no_error)); |
143 ON_CALL(*service, GetActiveDataTypes()).WillByDefault( | 143 ON_CALL(*service, GetActiveDataTypes()).WillByDefault( |
144 testing::Return(preferred_types)); | 144 testing::Return(preferred_types)); |
145 ON_CALL(*service, GetLocalDeviceInfoMock()).WillByDefault( | 145 ON_CALL(*service, GetLocalDeviceInfoMock()).WillByDefault( |
146 testing::Return(new browser_sync::DeviceInfo( | 146 testing::Return(new browser_sync::DeviceInfo( |
147 std::string(kSessionTags[0]), | 147 std::string(kSessionTags[0]), |
148 "machine name", | 148 "machine name", |
149 "Chromium 10k", | 149 "Chromium 10k", |
150 "Chrome 10k", | 150 "Chrome 10k", |
151 sync_pb::SyncEnums_DeviceType_TYPE_LINUX))); | 151 sync_pb::SyncEnums_DeviceType_TYPE_LINUX, |
| 152 "device_id"))); |
152 ON_CALL(*service, GetLocalSyncCacheGUID()).WillByDefault( | 153 ON_CALL(*service, GetLocalSyncCacheGUID()).WillByDefault( |
153 testing::Return(std::string(kSessionTags[0]))); | 154 testing::Return(std::string(kSessionTags[0]))); |
154 EXPECT_CALL(*service, AddObserver(testing::_)).Times(testing::AnyNumber()); | 155 EXPECT_CALL(*service, AddObserver(testing::_)).Times(testing::AnyNumber()); |
155 EXPECT_CALL(*service, RemoveObserver(testing::_)).Times(testing::AnyNumber()); | 156 EXPECT_CALL(*service, RemoveObserver(testing::_)).Times(testing::AnyNumber()); |
156 | 157 |
157 service->Initialize(); | 158 service->Initialize(); |
158 } | 159 } |
159 | 160 |
160 void ExtensionSessionsTest::CreateTestExtension() { | 161 void ExtensionSessionsTest::CreateTestExtension() { |
161 scoped_ptr<base::DictionaryValue> test_extension_value( | 162 scoped_ptr<base::DictionaryValue> test_extension_value( |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 343 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
343 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 344 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
344 return; | 345 return; |
345 #endif | 346 #endif |
346 | 347 |
347 ASSERT_TRUE(RunExtensionSubtest("sessions", | 348 ASSERT_TRUE(RunExtensionSubtest("sessions", |
348 "sessions.html")) << message_; | 349 "sessions.html")) << message_; |
349 } | 350 } |
350 | 351 |
351 } // namespace extensions | 352 } // namespace extensions |
OLD | NEW |