Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: chrome/browser/extensions/extension_service_sync_unittest.cc

Issue 2919953002: Revert of Unpack theme data from extensions off of UI thread. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ptr_util.h" 16 #include "base/memory/ptr_util.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/metrics/field_trial.h" 18 #include "base/metrics/field_trial.h"
19 #include "base/test/mock_entropy_provider.h" 19 #include "base/test/mock_entropy_provider.h"
20 #include "base/test/scoped_feature_list.h" 20 #include "base/test/scoped_feature_list.h"
21 #include "chrome/browser/chrome_notification_types.h"
22 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" 21 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h"
23 #include "chrome/browser/extensions/component_loader.h" 22 #include "chrome/browser/extensions/component_loader.h"
24 #include "chrome/browser/extensions/extension_service.h" 23 #include "chrome/browser/extensions/extension_service.h"
25 #include "chrome/browser/extensions/extension_service_test_with_install.h" 24 #include "chrome/browser/extensions/extension_service_test_with_install.h"
26 #include "chrome/browser/extensions/extension_sync_data.h" 25 #include "chrome/browser/extensions/extension_sync_data.h"
27 #include "chrome/browser/extensions/extension_sync_service.h" 26 #include "chrome/browser/extensions/extension_sync_service.h"
28 #include "chrome/browser/extensions/extension_util.h" 27 #include "chrome/browser/extensions/extension_util.h"
29 #include "chrome/browser/extensions/scripting_permissions_modifier.h" 28 #include "chrome/browser/extensions/scripting_permissions_modifier.h"
30 #include "chrome/browser/extensions/updater/extension_updater.h" 29 #include "chrome/browser/extensions/updater/extension_updater.h"
31 #include "chrome/browser/sync/profile_sync_service_factory.h" 30 #include "chrome/browser/sync/profile_sync_service_factory.h"
32 #include "chrome/browser/themes/theme_service.h"
33 #include "chrome/browser/themes/theme_service_factory.h"
34 #include "chrome/common/chrome_constants.h" 31 #include "chrome/common/chrome_constants.h"
35 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
36 #include "chrome/common/extensions/sync_helper.h" 33 #include "chrome/common/extensions/sync_helper.h"
37 #include "chrome/common/features.h" 34 #include "chrome/common/features.h"
38 #include "chrome/test/base/testing_profile.h" 35 #include "chrome/test/base/testing_profile.h"
39 #include "components/browser_sync/profile_sync_service.h" 36 #include "components/browser_sync/profile_sync_service.h"
40 #include "components/crx_file/id_util.h" 37 #include "components/crx_file/id_util.h"
41 #include "components/sync/model/fake_sync_change_processor.h" 38 #include "components/sync/model/fake_sync_change_processor.h"
42 #include "components/sync/model/sync_change_processor_wrapper_for_test.h" 39 #include "components/sync/model/sync_change_processor_wrapper_for_test.h"
43 #include "components/sync/model/sync_data.h" 40 #include "components/sync/model/sync_data.h"
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 1556
1560 // Sanity check: Installing an extension should result in a sync change. 1557 // Sanity check: Installing an extension should result in a sync change.
1561 InstallCRX(data_dir().AppendASCII("good.crx"), INSTALL_NEW); 1558 InstallCRX(data_dir().AppendASCII("good.crx"), INSTALL_NEW);
1562 EXPECT_EQ(1u, processor->changes().size()); 1559 EXPECT_EQ(1u, processor->changes().size());
1563 1560
1564 processor->changes().clear(); 1561 processor->changes().clear();
1565 1562
1566 // Installing a theme should not result in a sync change (themes are handled 1563 // Installing a theme should not result in a sync change (themes are handled
1567 // separately by ThemeSyncableService). 1564 // separately by ThemeSyncableService).
1568 InstallCRX(data_dir().AppendASCII("theme.crx"), INSTALL_NEW); 1565 InstallCRX(data_dir().AppendASCII("theme.crx"), INSTALL_NEW);
1569 content::WindowedNotificationObserver theme_change_observer(
1570 chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
1571 content::Source<ThemeService>(
1572 ThemeServiceFactory::GetForProfile(profile())));
1573 theme_change_observer.Wait();
1574 EXPECT_TRUE(processor->changes().empty()); 1566 EXPECT_TRUE(processor->changes().empty());
1575 } 1567 }
1576 1568
1577 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) 1569 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
1578 1570
1579 class ExtensionServiceTestSupervised 1571 class ExtensionServiceTestSupervised
1580 : public ExtensionServiceSyncCustomGalleryTest, 1572 : public ExtensionServiceSyncCustomGalleryTest,
1581 public SupervisedUserService::Delegate { 1573 public SupervisedUserService::Delegate {
1582 public: 1574 public:
1583 ExtensionServiceTestSupervised() 1575 ExtensionServiceTestSupervised()
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
2474 break; 2466 break;
2475 } 2467 }
2476 } 2468 }
2477 } 2469 }
2478 EXPECT_TRUE(found_delete); 2470 EXPECT_TRUE(found_delete);
2479 2471
2480 // Make sure there is one extension, and there are no more apps. 2472 // Make sure there is one extension, and there are no more apps.
2481 EXPECT_EQ(1u, extensions_processor.data().size()); 2473 EXPECT_EQ(1u, extensions_processor.data().size());
2482 EXPECT_TRUE(apps_processor.data().empty()); 2474 EXPECT_TRUE(apps_processor.data().empty());
2483 } 2475 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698