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

Unified Diff: chrome/browser/extensions/crx_installer_browsertest.cc

Issue 323843003: Add a do_not_sync pref to ExtensionPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for comments in #2 Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/crx_installer.h ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/crx_installer_browsertest.cc
diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc
index 375b57e3b7a9f85995dd2aa5735528094bc7755a..7c583a33efbe3a4dd16c313038b417c1958b4ab8 100644
--- a/chrome/browser/extensions/crx_installer_browsertest.cc
+++ b/chrome/browser/extensions/crx_installer_browsertest.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/fake_safe_browsing_database_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -50,8 +51,7 @@ class MockInstallPrompt;
// MockInstallPrompt. We create the MockInstallPrompt but need to pass
// ownership of it to CrxInstaller, so it isn't safe to hang this data on
// MockInstallPrompt itself becuase we can't guarantee it's lifetime.
-class MockPromptProxy :
- public base::RefCountedThreadSafe<MockPromptProxy> {
+class MockPromptProxy : public base::RefCountedThreadSafe<MockPromptProxy> {
public:
explicit MockPromptProxy(content::WebContents* web_contents);
@@ -116,10 +116,8 @@ class MockInstallPrompt : public ExtensionInstallPrompt {
scoped_refptr<MockPromptProxy> proxy_;
};
-
-MockPromptProxy::MockPromptProxy(content::WebContents* web_contents) :
- web_contents_(web_contents),
- confirmation_requested_(false) {
+MockPromptProxy::MockPromptProxy(content::WebContents* web_contents)
+ : web_contents_(web_contents), confirmation_requested_(false) {
}
MockPromptProxy::~MockPromptProxy() {}
@@ -366,7 +364,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, HiDpiThemeTest) {
base::FilePath crx_path = test_data_dir_.AppendASCII("theme_hidpi_crx");
crx_path = crx_path.AppendASCII("theme_hidpi.crx");
- ASSERT_TRUE(InstallExtension(crx_path,1));
+ ASSERT_TRUE(InstallExtension(crx_path, 1));
const std::string extension_id("gllekhaobjnhgeagipipnkpmmmpchacm");
ExtensionService* service = extensions::ExtensionSystem::Get(
@@ -428,7 +426,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest,
ASSERT_EQ("1.0", extension->version()->GetString());
// Make the extension idle again by closing the popup. This should not trigger
- //the delayed install.
+ // the delayed install.
content::RenderProcessHostWatcher terminated_observer(
extension_host->render_process_host(),
content::RenderProcessHostWatcher::WATCH_FOR_HOST_DESTRUCTION);
@@ -535,4 +533,21 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, InstallToSharedLocation) {
}
#endif
+IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, DoNotSync) {
+ ExtensionService* service = extensions::ExtensionSystem::Get(
+ browser()->profile())->extension_service();
+ scoped_refptr<CrxInstaller> crx_installer(
+ CrxInstaller::CreateSilent(service));
+ crx_installer->set_install_flag(kInstallFlagDoNotSync, true);
+ crx_installer->InstallCrx(test_data_dir_.AppendASCII("good.crx"));
+ EXPECT_TRUE(WaitForCrxInstallerDone());
+ ASSERT_TRUE(crx_installer->extension());
+
+ const ExtensionPrefs* extension_prefs =
+ ExtensionPrefs::Get(browser()->profile());
+ EXPECT_TRUE(extension_prefs->DoNotSync(crx_installer->extension()->id()));
+ EXPECT_FALSE(extensions::util::ShouldSyncApp(crx_installer->extension(),
+ browser()->profile()));
+}
+
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/crx_installer.h ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698