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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/settings/settings_frontend.h" | 10 #include "chrome/browser/extensions/settings/settings_frontend.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 new SyncChangeProcessorDelegate(sync_processor))).IsSet()); | 165 new SyncChangeProcessorDelegate(sync_processor))).IsSet()); |
166 } | 166 } |
167 | 167 |
168 void SendChangesToSyncableService( | 168 void SendChangesToSyncableService( |
169 const SyncChangeList& change_list, SyncableService* settings_service) { | 169 const SyncChangeList& change_list, SyncableService* settings_service) { |
170 EXPECT_FALSE( | 170 EXPECT_FALSE( |
171 settings_service->ProcessSyncChanges(FROM_HERE, change_list).IsSet()); | 171 settings_service->ProcessSyncChanges(FROM_HERE, change_list).IsSet()); |
172 } | 172 } |
173 }; | 173 }; |
174 | 174 |
175 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, SimpleTest) { | 175 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, DISABLED_SimpleTest) { |
176 CommandLine::ForCurrentProcess()->AppendSwitch( | 176 CommandLine::ForCurrentProcess()->AppendSwitch( |
177 switches::kEnableExperimentalExtensionApis); | 177 switches::kEnableExperimentalExtensionApis); |
178 ASSERT_TRUE(RunExtensionTest("settings/simple_test")) << message_; | 178 ASSERT_TRUE(RunExtensionTest("settings/simple_test")) << message_; |
179 } | 179 } |
180 | 180 |
181 // Structure of this test taken from IncognitoSplitMode. | 181 // Structure of this test taken from IncognitoSplitMode. |
182 // Note that only split-mode incognito is tested, because spanning mode | 182 // Note that only split-mode incognito is tested, because spanning mode |
183 // incognito looks the same as normal mode when the only API activity comes | 183 // incognito looks the same as normal mode when the only API activity comes |
184 // from background pages. | 184 // from background pages. |
185 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, SplitModeIncognito) { | 185 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, DISABLED_SplitModeIncognito) { |
186 CommandLine::ForCurrentProcess()->AppendSwitch( | 186 CommandLine::ForCurrentProcess()->AppendSwitch( |
187 switches::kEnableExperimentalExtensionApis); | 187 switches::kEnableExperimentalExtensionApis); |
188 | 188 |
189 // We need 2 ResultCatchers because we'll be running the same test in both | 189 // We need 2 ResultCatchers because we'll be running the same test in both |
190 // regular and incognito mode. | 190 // regular and incognito mode. |
191 ResultCatcher catcher, catcher_incognito; | 191 ResultCatcher catcher, catcher_incognito; |
192 catcher.RestrictToProfile(browser()->profile()); | 192 catcher.RestrictToProfile(browser()->profile()); |
193 catcher_incognito.RestrictToProfile( | 193 catcher_incognito.RestrictToProfile( |
194 browser()->profile()->GetOffTheRecordProfile()); | 194 browser()->profile()->GetOffTheRecordProfile()); |
195 | 195 |
196 LoadAndReplyWhenSatisfied(SYNC, | 196 LoadAndReplyWhenSatisfied(SYNC, |
197 "assertEmpty", "assertEmpty", "split_incognito"); | 197 "assertEmpty", "assertEmpty", "split_incognito"); |
198 ReplyWhenSatisfied(SYNC, "noop", "setFoo"); | 198 ReplyWhenSatisfied(SYNC, "noop", "setFoo"); |
199 ReplyWhenSatisfied(SYNC, "assertFoo", "assertFoo"); | 199 ReplyWhenSatisfied(SYNC, "assertFoo", "assertFoo"); |
200 ReplyWhenSatisfied(SYNC, "clear", "noop"); | 200 ReplyWhenSatisfied(SYNC, "clear", "noop"); |
201 ReplyWhenSatisfied(SYNC, "assertEmpty", "assertEmpty"); | 201 ReplyWhenSatisfied(SYNC, "assertEmpty", "assertEmpty"); |
202 ReplyWhenSatisfied(SYNC, "setFoo", "noop"); | 202 ReplyWhenSatisfied(SYNC, "setFoo", "noop"); |
203 ReplyWhenSatisfied(SYNC, "assertFoo", "assertFoo"); | 203 ReplyWhenSatisfied(SYNC, "assertFoo", "assertFoo"); |
204 ReplyWhenSatisfied(SYNC, "noop", "removeFoo"); | 204 ReplyWhenSatisfied(SYNC, "noop", "removeFoo"); |
205 FinalReplyWhenSatisfied(SYNC, "assertEmpty", "assertEmpty"); | 205 FinalReplyWhenSatisfied(SYNC, "assertEmpty", "assertEmpty"); |
206 | 206 |
207 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 207 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
208 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); | 208 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); |
209 } | 209 } |
210 | 210 |
211 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, | 211 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, |
212 OnChangedNotificationsBetweenBackgroundPages) { | 212 DISABLED_OnChangedNotificationsBetweenBackgroundPages) { |
213 CommandLine::ForCurrentProcess()->AppendSwitch( | 213 CommandLine::ForCurrentProcess()->AppendSwitch( |
214 switches::kEnableExperimentalExtensionApis); | 214 switches::kEnableExperimentalExtensionApis); |
215 | 215 |
216 // We need 2 ResultCatchers because we'll be running the same test in both | 216 // We need 2 ResultCatchers because we'll be running the same test in both |
217 // regular and incognito mode. | 217 // regular and incognito mode. |
218 ResultCatcher catcher, catcher_incognito; | 218 ResultCatcher catcher, catcher_incognito; |
219 catcher.RestrictToProfile(browser()->profile()); | 219 catcher.RestrictToProfile(browser()->profile()); |
220 catcher_incognito.RestrictToProfile( | 220 catcher_incognito.RestrictToProfile( |
221 browser()->profile()->GetOffTheRecordProfile()); | 221 browser()->profile()->GetOffTheRecordProfile()); |
222 | 222 |
223 LoadAndReplyWhenSatisfied(SYNC, | 223 LoadAndReplyWhenSatisfied(SYNC, |
224 "assertNoNotifications", "assertNoNotifications", "split_incognito"); | 224 "assertNoNotifications", "assertNoNotifications", "split_incognito"); |
225 ReplyWhenSatisfied(SYNC, "noop", "setFoo"); | 225 ReplyWhenSatisfied(SYNC, "noop", "setFoo"); |
226 ReplyWhenSatisfied(SYNC, | 226 ReplyWhenSatisfied(SYNC, |
227 "assertAddFooNotification", "assertAddFooNotification"); | 227 "assertAddFooNotification", "assertAddFooNotification"); |
228 ReplyWhenSatisfied(SYNC, "clearNotifications", "clearNotifications"); | 228 ReplyWhenSatisfied(SYNC, "clearNotifications", "clearNotifications"); |
229 ReplyWhenSatisfied(SYNC, "removeFoo", "noop"); | 229 ReplyWhenSatisfied(SYNC, "removeFoo", "noop"); |
230 FinalReplyWhenSatisfied(SYNC, | 230 FinalReplyWhenSatisfied(SYNC, |
231 "assertDeleteFooNotification", "assertDeleteFooNotification"); | 231 "assertDeleteFooNotification", "assertDeleteFooNotification"); |
232 | 232 |
233 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 233 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
234 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); | 234 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); |
235 } | 235 } |
236 | 236 |
237 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, | 237 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, |
238 SyncAndLocalAreasAreSeparate) { | 238 DISABLED_SyncAndLocalAreasAreSeparate) { |
239 CommandLine::ForCurrentProcess()->AppendSwitch( | 239 CommandLine::ForCurrentProcess()->AppendSwitch( |
240 switches::kEnableExperimentalExtensionApis); | 240 switches::kEnableExperimentalExtensionApis); |
241 | 241 |
242 // We need 2 ResultCatchers because we'll be running the same test in both | 242 // We need 2 ResultCatchers because we'll be running the same test in both |
243 // regular and incognito mode. | 243 // regular and incognito mode. |
244 ResultCatcher catcher, catcher_incognito; | 244 ResultCatcher catcher, catcher_incognito; |
245 catcher.RestrictToProfile(browser()->profile()); | 245 catcher.RestrictToProfile(browser()->profile()); |
246 catcher_incognito.RestrictToProfile( | 246 catcher_incognito.RestrictToProfile( |
247 browser()->profile()->GetOffTheRecordProfile()); | 247 browser()->profile()->GetOffTheRecordProfile()); |
248 | 248 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 SendChanges(sync_changes); | 372 SendChanges(sync_changes); |
373 | 373 |
374 FinalReplyWhenSatisfied(LOCAL, | 374 FinalReplyWhenSatisfied(LOCAL, |
375 "assertNoNotifications", "assertNoNotifications"); | 375 "assertNoNotifications", "assertNoNotifications"); |
376 | 376 |
377 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 377 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
378 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); | 378 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); |
379 } | 379 } |
380 | 380 |
381 } // namespace extensions | 381 } // namespace extensions |
OLD | NEW |