Commit 7cd54377 authored by proberge's avatar proberge Committed by Commit Bot

Reland "Extension content verification: unify "is from store" logic"

(Not a direct reland: the change to extension_settings_browsertest.h
was not in the original CL)

This is a reland of f3bd7c65
Original change's description:
> Extension content verification: unify "is from store" logic
> 
> Bug: 766806
> Change-Id: I1a210ded77cc9ffdc0039fca097c6fdba7ff0131
> Reviewed-on: https://chromium-review.googlesource.com/677403
> Commit-Queue: proberge <proberge@chromium.org>
> Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#505092}

Bug: 766806
Change-Id: I4a0c69c50d7bc41a47e264ad9b9e3136a729ec96
Reviewed-on: https://chromium-review.googlesource.com/698985Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: proberge <proberge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506422}
parent 7fd80224
......@@ -21,6 +21,7 @@
#include "base/version.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/install_verifier.h"
#include "chrome/browser/extensions/policy_extension_reinstaller.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension_constants.h"
......@@ -130,7 +131,10 @@ ContentVerifierDelegate::Mode ChromeContentVerifierDelegate::ShouldBeVerified(
if (!Manifest::IsAutoUpdateableLocation(extension.location()))
return ContentVerifierDelegate::NONE;
if (!ManifestURL::UpdatesFromGallery(&extension)) {
// Use the InstallVerifier's |IsFromStore| method to avoid discrepancies
// between which extensions are considered in-store.
// See https://crbug.com/766806 for details.
if (!InstallVerifier::IsFromStore(extension)) {
// It's possible that the webstore update url was overridden for testing
// so also consider extensions with the default (production) update url
// to be from the store as well.
......
......@@ -10,6 +10,7 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "chrome/test/base/web_ui_browser_test.h"
#include "extensions/browser/scoped_ignore_content_verifier_for_test.h"
#include "extensions/browser/test_management_policy.h"
#include "extensions/common/feature_switch.h"
......@@ -55,6 +56,9 @@ class ExtensionSettingsUIBrowserTest : public WebUIBrowserTest {
base::FilePath test_data_dir_;
// Disable extension content verification.
extensions::ScopedIgnoreContentVerifierForTest ignore_content_verification_;
// Used to enable the error console.
std::unique_ptr<extensions::FeatureSwitch::ScopedOverride>
error_console_override_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment