| 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/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "chrome/browser/download/download_crx_util.h" | 7 #include "chrome/browser/download/download_crx_util.h" |
| 8 #include "chrome/browser/extensions/browser_action_test_util.h" | 8 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
| 10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 | 531 |
| 532 EXPECT_FALSE(base::PathExists(extension_path)); | 532 EXPECT_FALSE(base::PathExists(extension_path)); |
| 533 } | 533 } |
| 534 #endif | 534 #endif |
| 535 | 535 |
| 536 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, DoNotSync) { | 536 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, DoNotSync) { |
| 537 ExtensionService* service = extensions::ExtensionSystem::Get( | 537 ExtensionService* service = extensions::ExtensionSystem::Get( |
| 538 browser()->profile())->extension_service(); | 538 browser()->profile())->extension_service(); |
| 539 scoped_refptr<CrxInstaller> crx_installer( | 539 scoped_refptr<CrxInstaller> crx_installer( |
| 540 CrxInstaller::CreateSilent(service)); | 540 CrxInstaller::CreateSilent(service)); |
| 541 crx_installer->set_install_flag(kInstallFlagDoNotSync, true); | 541 crx_installer->set_do_not_sync(true); |
| 542 crx_installer->InstallCrx(test_data_dir_.AppendASCII("good.crx")); | 542 crx_installer->InstallCrx(test_data_dir_.AppendASCII("good.crx")); |
| 543 EXPECT_TRUE(WaitForCrxInstallerDone()); | 543 EXPECT_TRUE(WaitForCrxInstallerDone()); |
| 544 ASSERT_TRUE(crx_installer->extension()); | 544 ASSERT_TRUE(crx_installer->extension()); |
| 545 | 545 |
| 546 const ExtensionPrefs* extension_prefs = | 546 const ExtensionPrefs* extension_prefs = |
| 547 ExtensionPrefs::Get(browser()->profile()); | 547 ExtensionPrefs::Get(browser()->profile()); |
| 548 EXPECT_TRUE(extension_prefs->DoNotSync(crx_installer->extension()->id())); | 548 EXPECT_TRUE(extension_prefs->DoNotSync(crx_installer->extension()->id())); |
| 549 EXPECT_FALSE(extensions::util::ShouldSyncApp(crx_installer->extension(), | 549 EXPECT_FALSE(extensions::util::ShouldSyncApp(crx_installer->extension(), |
| 550 browser()->profile())); | 550 browser()->profile())); |
| 551 } | 551 } |
| 552 | 552 |
| 553 } // namespace extensions | 553 } // namespace extensions |
| OLD | NEW |