diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-18 14:11:14 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-18 14:11:14 +0000 |
commit | a93cdd778d054de16f88bceaf890b4869f7918cc (patch) | |
tree | f7e10eec1eb38c6d54e6bd171a7d1f67a08766d5 | |
parent | 2693f5c97de93af6cad5b5f0c42cf604981d999f (diff) | |
download | chromium_src-a93cdd778d054de16f88bceaf890b4869f7918cc.zip chromium_src-a93cdd778d054de16f88bceaf890b4869f7918cc.tar.gz chromium_src-a93cdd778d054de16f88bceaf890b4869f7918cc.tar.bz2 |
Get list of active content packs for Managed Mode from the extension service.
When ever the list of active content packs changes, the whitelist is updated accordingly.
BUG=141842
Review URL: https://chromiumcodereview.appspot.com/11820026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177663 0039d316-1c4b-4281-b951-d872f2087c98
10 files changed, 284 insertions, 53 deletions
diff --git a/chrome/browser/managed_mode/managed_mode.cc b/chrome/browser/managed_mode/managed_mode.cc index 7ce4e2d..5eead29 100644 --- a/chrome/browser/managed_mode/managed_mode.cc +++ b/chrome/browser/managed_mode/managed_mode.cc @@ -39,7 +39,7 @@ class ManagedMode::URLFilterContext { : task_runner_(task_runner) {} ~URLFilterContext() {} - const ManagedModeURLFilter* url_filter() const { + ManagedModeURLFilter* url_filter() { DCHECK(task_runner_->RunsTasksOnCurrentThread()); return &url_filter_; } @@ -61,8 +61,7 @@ class ManagedMode::URLFilterContext { task_runner_->PostTask(FROM_HERE, base::Bind(&ManagedModeURLFilter::LoadWhitelists, base::Unretained(&url_filter_), - base::Passed(&site_lists), - base::Bind(&base::DoNothing))); + base::Passed(&site_lists))); } void SetManualLists(scoped_ptr<ListValue> whitelist, @@ -234,11 +233,11 @@ const ManagedModeURLFilter* ManagedMode::GetURLFilterForUIThread() { return GetInstance()->GetURLFilterForUIThreadImpl(); } -const ManagedModeURLFilter* ManagedMode::GetURLFilterForIOThreadImpl() { +ManagedModeURLFilter* ManagedMode::GetURLFilterForIOThreadImpl() { return io_url_filter_context_->url_filter(); } -const ManagedModeURLFilter* ManagedMode::GetURLFilterForUIThreadImpl() { +ManagedModeURLFilter* ManagedMode::GetURLFilterForUIThreadImpl() { return ui_url_filter_context_->url_filter(); } @@ -409,21 +408,31 @@ ManagedMode::~ManagedMode() { void ManagedMode::Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) { - // Return early if we don't have any queued callbacks. - if (callbacks_.empty()) - return; - switch (type) { case chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST: { - FinalizeEnter(false); + if (!callbacks_.empty()) + FinalizeEnter(false); return; } case chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED: { Browser* browser = content::Source<Browser>(source).ptr(); - if (browsers_to_close_.find(browser) != browsers_to_close_.end()) + if (!callbacks_.empty() && browsers_to_close_.find(browser) != + browsers_to_close_.end()) FinalizeEnter(false); return; } + case chrome::NOTIFICATION_EXTENSION_LOADED: + case chrome::NOTIFICATION_EXTENSION_UNLOADED: { + if (!managed_profile_) + break; + + const extensions::Extension* extension = + content::Details<const extensions::Extension>(details).ptr(); + if (!extension->GetContentPackSiteList().empty()) + UpdateManualListsImpl(); + + break; + } default: NOTREACHED(); } @@ -460,6 +469,10 @@ void ManagedMode::SetInManagedMode(Profile* newly_managed_profile) { DCHECK(!managed_profile_ || managed_profile_ == newly_managed_profile); extensions::ExtensionSystem::Get( newly_managed_profile)->management_policy()->RegisterProvider(this); + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, + content::Source<Profile>(newly_managed_profile)); + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, + content::Source<Profile>(newly_managed_profile)); pref_change_registrar_.reset(new PrefChangeRegistrar()); pref_change_registrar_->Init(newly_managed_profile->GetPrefs()); pref_change_registrar_->Add( @@ -470,6 +483,10 @@ void ManagedMode::SetInManagedMode(Profile* newly_managed_profile) { } else { extensions::ExtensionSystem::Get( managed_profile_)->management_policy()->UnregisterProvider(this); + registrar_.Remove(this, chrome::NOTIFICATION_EXTENSION_LOADED, + content::Source<Profile>(managed_profile_)); + registrar_.Remove(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, + content::Source<Profile>(managed_profile_)); pref_change_registrar_.reset(); } @@ -497,8 +514,21 @@ void ManagedMode::SetInManagedMode(Profile* newly_managed_profile) { ScopedVector<ManagedModeSiteList> ManagedMode::GetActiveSiteLists() { DCHECK(managed_profile_); + ExtensionService* extension_service = + extensions::ExtensionSystem::Get(managed_profile_)->extension_service(); + const ExtensionSet* extensions = extension_service->extensions(); ScopedVector<ManagedModeSiteList> site_lists; - // TODO(bauerb): Get site lists from all extensions. + for (ExtensionSet::const_iterator it = extensions->begin(); + it != extensions->end(); ++it) { + const extensions::Extension* extension = *it; + if (!extension_service->IsExtensionEnabled(extension->id())) + continue; + + ExtensionResource site_list = extension->GetContentPackSiteList(); + if (!site_list.empty()) + site_lists.push_back(new ManagedModeSiteList(extension->id(), site_list)); + } + return site_lists.Pass(); } diff --git a/chrome/browser/managed_mode/managed_mode.h b/chrome/browser/managed_mode/managed_mode.h index b725015..f7d998a 100644 --- a/chrome/browser/managed_mode/managed_mode.h +++ b/chrome/browser/managed_mode/managed_mode.h @@ -126,6 +126,7 @@ class ManagedMode : public chrome::BrowserListObserver, FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest, ManagedModeOnChange); FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, ManagedModeProhibitsModification); + FRIEND_TEST_ALL_PREFIXES(ManagedModeContentPackTest, InstallContentPacks); static ManagedMode* GetInstance(); @@ -138,8 +139,8 @@ class ManagedMode : public chrome::BrowserListObserver, void LeaveManagedModeImpl(); - const ManagedModeURLFilter* GetURLFilterForIOThreadImpl(); - const ManagedModeURLFilter* GetURLFilterForUIThreadImpl(); + ManagedModeURLFilter* GetURLFilterForIOThreadImpl(); + ManagedModeURLFilter* GetURLFilterForUIThreadImpl(); void FinalizeEnter(bool result); diff --git a/chrome/browser/managed_mode/managed_mode_browsertest.cc b/chrome/browser/managed_mode/managed_mode_browsertest.cc index 0cafc3c..1aef679 100644 --- a/chrome/browser/managed_mode/managed_mode_browsertest.cc +++ b/chrome/browser/managed_mode/managed_mode_browsertest.cc @@ -1,17 +1,23 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/command_line.h" +#include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" +#include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/infobars/infobar.h" #include "chrome/browser/infobars/infobar_tab_helper.h" #include "chrome/browser/managed_mode/managed_mode.h" +#include "chrome/browser/managed_mode/managed_mode_url_filter.h" +#include "chrome/browser/prefs/pref_service.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/interstitial_page.h" @@ -20,11 +26,128 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" +#include "content/public/test/test_utils.h" +#include "googleurl/src/gurl.h" using content::InterstitialPage; -using content::WebContents; +using content::MessageLoopRunner; using content::NavigationController; using content::NavigationEntry; +using content::WebContents; + +namespace { + +class ManagedModeURLFilterObserver : public ManagedModeURLFilter::Observer { + public: + explicit ManagedModeURLFilterObserver(ManagedModeURLFilter* url_filter) + : url_filter_(url_filter) { + Reset(); + url_filter_->AddObserver(this); + } + + ~ManagedModeURLFilterObserver() { + url_filter_->RemoveObserver(this); + } + + void Wait() { + message_loop_runner_->Run(); + Reset(); + } + + // ManagedModeURLFilter::Observer + virtual void OnSiteListUpdated() OVERRIDE { + message_loop_runner_->Quit(); + } + + private: + void Reset() { + message_loop_runner_ = new MessageLoopRunner; + } + + ManagedModeURLFilter* url_filter_; + scoped_refptr<MessageLoopRunner> message_loop_runner_; +}; + +} // namespace + +class ManagedModeContentPackTest : public ExtensionBrowserTest { + public: + ManagedModeContentPackTest() {} + virtual ~ManagedModeContentPackTest() {} + + virtual void SetUpOnMainThread() OVERRIDE { + PrefService* prefs = browser()->profile()->GetPrefs(); + prefs->SetInteger(prefs::kDefaultManagedModeFilteringBehavior, + ManagedModeURLFilter::WARN); + } +}; + +IN_PROC_BROWSER_TEST_F(ManagedModeContentPackTest, InstallContentPacks) { + ManagedMode* managed_mode = ManagedMode::GetInstance(); + ManagedModeURLFilter* url_filter = + managed_mode->GetURLFilterForUIThreadImpl(); + ManagedModeURLFilterObserver observer(url_filter); + + GURL example_url("http://example.com"); + GURL moose_url("http://moose.org"); + EXPECT_EQ(ManagedModeURLFilter::ALLOW, + url_filter->GetFilteringBehaviorForURL(example_url)); + + managed_mode->SetInManagedMode(browser()->profile()); + observer.Wait(); + + EXPECT_EQ(ManagedModeURLFilter::WARN, + url_filter->GetFilteringBehaviorForURL(example_url)); + + // Load a content pack. + const extensions::Extension* extension = LoadExtension( + test_data_dir_.AppendASCII("managed_mode/content_pack")); + ASSERT_TRUE(extension) << "Failed to load extension."; + observer.Wait(); + + ScopedVector<ManagedModeSiteList> site_lists = + managed_mode->GetActiveSiteLists(); + ASSERT_EQ(1u, site_lists.size()); + std::vector<ManagedModeSiteList::Site> sites; + site_lists[0]->GetSites(&sites); + ASSERT_EQ(3u, sites.size()); + EXPECT_EQ(ASCIIToUTF16("YouTube"), sites[0].name); + EXPECT_EQ(ASCIIToUTF16("Homestar Runner"), sites[1].name); + EXPECT_EQ(string16(), sites[2].name); + + EXPECT_EQ(ManagedModeURLFilter::ALLOW, + url_filter->GetFilteringBehaviorForURL(example_url)); + EXPECT_EQ(ManagedModeURLFilter::WARN, + url_filter->GetFilteringBehaviorForURL(moose_url)); + + // Load a second content pack. + extension = LoadExtension( + test_data_dir_.AppendASCII("managed_mode/content_pack_2")); + ASSERT_TRUE(extension) << "Failed to load extension."; + observer.Wait(); + + site_lists = managed_mode->GetActiveSiteLists(); + ASSERT_EQ(2u, site_lists.size()); + sites.clear(); + site_lists[0]->GetSites(&sites); + site_lists[1]->GetSites(&sites); + ASSERT_EQ(4u, sites.size()); + // The site lists might be returned in any order, so we put them into a set. + std::set<std::string> site_names; + for (std::vector<ManagedModeSiteList::Site>::const_iterator it = + sites.begin(); it != sites.end(); ++it) { + site_names.insert(UTF16ToUTF8(it->name)); + } + EXPECT_TRUE(site_names.count("YouTube") == 1u); + EXPECT_TRUE(site_names.count("Homestar Runner") == 1u); + EXPECT_TRUE(site_names.count(std::string()) == 1u); + EXPECT_TRUE(site_names.count("Moose") == 1u); + + EXPECT_EQ(ManagedModeURLFilter::ALLOW, + url_filter->GetFilteringBehaviorForURL(example_url)); + EXPECT_EQ(ManagedModeURLFilter::ALLOW, + url_filter->GetFilteringBehaviorForURL(moose_url)); +} // TODO(sergiu): Make the webkit error message disappear when navigating to an // interstitial page. The message states: "Not allowed to load local resource: diff --git a/chrome/browser/managed_mode/managed_mode_url_filter.cc b/chrome/browser/managed_mode/managed_mode_url_filter.cc index 321eebe..4534321 100644 --- a/chrome/browser/managed_mode/managed_mode_url_filter.cc +++ b/chrome/browser/managed_mode/managed_mode_url_filter.cc @@ -254,8 +254,7 @@ void ManagedModeURLFilter::SetDefaultFilteringBehavior( } void ManagedModeURLFilter::LoadWhitelists( - ScopedVector<ManagedModeSiteList> site_lists, - const base::Closure& continuation) { + ScopedVector<ManagedModeSiteList> site_lists) { DCHECK(CalledOnValidThread()); base::PostTaskAndReplyWithResult( @@ -264,12 +263,11 @@ void ManagedModeURLFilter::LoadWhitelists( base::Bind(&LoadWhitelistsOnBlockingPoolThread, base::Passed(&site_lists)), base::Bind(&ManagedModeURLFilter::SetContents, - weak_ptr_factory_.GetWeakPtr(), continuation)); + weak_ptr_factory_.GetWeakPtr())); } void ManagedModeURLFilter::SetFromPatterns( - const std::vector<std::string>& patterns, - const base::Closure& continuation) { + const std::vector<std::string>& patterns) { DCHECK(CalledOnValidThread()); base::PostTaskAndReplyWithResult( @@ -277,7 +275,7 @@ void ManagedModeURLFilter::SetFromPatterns( FROM_HERE, base::Bind(&CreateWhitelistFromPatterns, patterns), base::Bind(&ManagedModeURLFilter::SetContents, - weak_ptr_factory_.GetWeakPtr(), continuation)); + weak_ptr_factory_.GetWeakPtr())); } void ManagedModeURLFilter::SetManualLists(scoped_ptr<ListValue> whitelist, @@ -320,9 +318,16 @@ void ManagedModeURLFilter::AddURLPatternToManualList( url_manual_list_block_->Block(&list); } -void ManagedModeURLFilter::SetContents(const base::Closure& continuation, - scoped_ptr<Contents> contents) { +void ManagedModeURLFilter::AddObserver(Observer* observer) { + observers_.AddObserver(observer); +} + +void ManagedModeURLFilter::RemoveObserver(Observer* observer) { + observers_.RemoveObserver(observer); +} + +void ManagedModeURLFilter::SetContents(scoped_ptr<Contents> contents) { DCHECK(CalledOnValidThread()); contents_ = contents.Pass(); - continuation.Run(); + FOR_EACH_OBSERVER(Observer, observers_, OnSiteListUpdated()); } diff --git a/chrome/browser/managed_mode/managed_mode_url_filter.h b/chrome/browser/managed_mode/managed_mode_url_filter.h index 6537af9..53a53ea 100644 --- a/chrome/browser/managed_mode/managed_mode_url_filter.h +++ b/chrome/browser/managed_mode/managed_mode_url_filter.h @@ -9,6 +9,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" +#include "base/observer_list.h" #include "base/threading/non_thread_safe.h" #include "base/values.h" #include "chrome/browser/managed_mode/managed_mode_site_list.h" @@ -32,6 +33,11 @@ class ManagedModeURLFilter : public base::NonThreadSafe { BLOCK }; + class Observer { + public: + virtual void OnSiteListUpdated() = 0; + }; + struct Contents; ManagedModeURLFilter(); @@ -52,13 +58,11 @@ class ManagedModeURLFilter : public base::NonThreadSafe { // Asynchronously loads the specified site lists from disk and updates the // filter to recognize each site on them. // Calls |continuation| when the filter has been updated. - void LoadWhitelists(ScopedVector<ManagedModeSiteList> site_lists, - const base::Closure& continuation); + void LoadWhitelists(ScopedVector<ManagedModeSiteList> site_lists); // Set the list of matched patterns to the passed in list. // This method is only used for testing. - void SetFromPatterns(const std::vector<std::string>& patterns, - const base::Closure& continuation); + void SetFromPatterns(const std::vector<std::string>& patterns); // Sets the manual lists. void SetManualLists(scoped_ptr<ListValue> whitelist, @@ -69,9 +73,13 @@ class ManagedModeURLFilter : public base::NonThreadSafe { void AddURLPatternToManualList(const bool is_whitelist, const std::string& url_pattern); + void AddObserver(Observer* observer); + void RemoveObserver(Observer* observer); + private: - void SetContents(const base::Closure& callback, - scoped_ptr<Contents> url_matcher); + void SetContents(scoped_ptr<Contents> url_matcher); + + ObserverList<Observer> observers_; base::WeakPtrFactory<ManagedModeURLFilter> weak_ptr_factory_; FilteringBehavior default_behavior_; diff --git a/chrome/browser/managed_mode/managed_mode_url_filter_unittest.cc b/chrome/browser/managed_mode/managed_mode_url_filter_unittest.cc index 1fbcf70..c8f7ee6 100644 --- a/chrome/browser/managed_mode/managed_mode_url_filter_unittest.cc +++ b/chrome/browser/managed_mode/managed_mode_url_filter_unittest.cc @@ -38,14 +38,21 @@ base::Closure FailClosure(const base::Closure& continuation) { } // namespace -class ManagedModeURLFilterTest : public ::testing::Test { +class ManagedModeURLFilterTest : public ::testing::Test, + public ManagedModeURLFilter::Observer { public: - ManagedModeURLFilterTest() {} - virtual ~ManagedModeURLFilterTest() {} - - virtual void SetUp() OVERRIDE { - filter_.reset(new ManagedModeURLFilter); + ManagedModeURLFilterTest() : filter_(new ManagedModeURLFilter) { filter_->SetDefaultFilteringBehavior(ManagedModeURLFilter::BLOCK); + filter_->AddObserver(this); + } + + virtual ~ManagedModeURLFilterTest() { + filter_->RemoveObserver(this); + } + + // ManagedModeURLFilter::Observer: + virtual void OnSiteListUpdated() OVERRIDE { + run_loop_.Quit(); } protected: @@ -63,7 +70,7 @@ TEST_F(ManagedModeURLFilterTest, Basic) { std::vector<std::string> list; // Allow domain and all subdomains, for any filtered scheme. list.push_back("google.com"); - filter_->SetFromPatterns(list, run_loop_.QuitClosure()); + filter_->SetFromPatterns(list); run_loop_.Run(); EXPECT_TRUE(IsURLWhitelisted("http://google.com")); @@ -85,7 +92,7 @@ TEST_F(ManagedModeURLFilterTest, Inactive) { std::vector<std::string> list; list.push_back("google.com"); - filter_->SetFromPatterns(list, run_loop_.QuitClosure()); + filter_->SetFromPatterns(list); run_loop_.Run(); // If the filter is inactive, every URL should be whitelisted. @@ -93,22 +100,13 @@ TEST_F(ManagedModeURLFilterTest, Inactive) { EXPECT_TRUE(IsURLWhitelisted("https://www.example.com")); } -TEST_F(ManagedModeURLFilterTest, Shutdown) { - std::vector<std::string> list; - list.push_back("google.com"); - filter_->SetFromPatterns(list, FailClosure(run_loop_.QuitClosure())); - // Destroy the filter before we set the URLMatcher. - filter_.reset(); - run_loop_.Run(); -} - TEST_F(ManagedModeURLFilterTest, Scheme) { std::vector<std::string> list; // Filter only http, ftp and ws schemes. list.push_back("http://secure.com"); list.push_back("ftp://secure.com"); list.push_back("ws://secure.com"); - filter_->SetFromPatterns(list, run_loop_.QuitClosure()); + filter_->SetFromPatterns(list); run_loop_.Run(); EXPECT_TRUE(IsURLWhitelisted("http://secure.com")); @@ -126,7 +124,7 @@ TEST_F(ManagedModeURLFilterTest, Path) { std::vector<std::string> list; // Filter only a certain path prefix. list.push_back("path.to/ruin"); - filter_->SetFromPatterns(list, run_loop_.QuitClosure()); + filter_->SetFromPatterns(list); run_loop_.Run(); EXPECT_TRUE(IsURLWhitelisted("http://path.to/ruin")); @@ -141,7 +139,7 @@ TEST_F(ManagedModeURLFilterTest, PathAndScheme) { std::vector<std::string> list; // Filter only a certain path prefix and scheme. list.push_back("https://s.aaa.com/path"); - filter_->SetFromPatterns(list, run_loop_.QuitClosure()); + filter_->SetFromPatterns(list); run_loop_.Run(); EXPECT_TRUE(IsURLWhitelisted("https://s.aaa.com/path")); @@ -157,7 +155,7 @@ TEST_F(ManagedModeURLFilterTest, Host) { std::vector<std::string> list; // Filter only a certain hostname, without subdomains. list.push_back(".www.example.com"); - filter_->SetFromPatterns(list, run_loop_.QuitClosure()); + filter_->SetFromPatterns(list); run_loop_.Run(); EXPECT_TRUE(IsURLWhitelisted("http://www.example.com")); @@ -169,7 +167,7 @@ TEST_F(ManagedModeURLFilterTest, IPAddress) { std::vector<std::string> list; // Filter an ip address. list.push_back("123.123.123.123"); - filter_->SetFromPatterns(list, run_loop_.QuitClosure()); + filter_->SetFromPatterns(list); run_loop_.Run(); EXPECT_TRUE(IsURLWhitelisted("http://123.123.123.123/")); diff --git a/chrome/test/data/extensions/managed_mode/content_pack/manifest.json b/chrome/test/data/extensions/managed_mode/content_pack/manifest.json new file mode 100644 index 0000000..41b7fcf --- /dev/null +++ b/chrome/test/data/extensions/managed_mode/content_pack/manifest.json @@ -0,0 +1,8 @@ +{ + "name": "Test Content Pack", + "version": "0.1", + "manifest_version": 2, + "content_pack": { + "sites": "site_list.json" + } +} diff --git a/chrome/test/data/extensions/managed_mode/content_pack/site_list.json b/chrome/test/data/extensions/managed_mode/content_pack/site_list.json new file mode 100644 index 0000000..99cdfb8 --- /dev/null +++ b/chrome/test/data/extensions/managed_mode/content_pack/site_list.json @@ -0,0 +1,39 @@ +{ + "version": 1, + "categories": { + "org.example.entertainment": { + "name": "Entertainment", + "thumbnails": { + "128": "entertainment.jpg" + } + } + }, + "sites": [ + { + "name": "YouTube", + "url": "http://www.youtube.com", + "categories": [ + "org.example.entertainment" + ], + "thumbnails": { + "128": "youtube_128.png" + }, + "whitelist": [ + "youtube.com", + "ytimg.com", + "https://googleusercontent.com", + "gstatic.com" + ] + }, + { + "name": "Homestar Runner", + "url": "http://homestarrunner.com" + }, + { + "whitelist": [ + "example.com", + "www.iana.org/domains/example/" + ] + } + ] +} diff --git a/chrome/test/data/extensions/managed_mode/content_pack_2/manifest.json b/chrome/test/data/extensions/managed_mode/content_pack_2/manifest.json new file mode 100644 index 0000000..1224986 --- /dev/null +++ b/chrome/test/data/extensions/managed_mode/content_pack_2/manifest.json @@ -0,0 +1,8 @@ +{ + "name": "Test Content Pack (Moose)", + "version": "0.1", + "manifest_version": 2, + "content_pack": { + "sites": "site_list.json" + } +} diff --git a/chrome/test/data/extensions/managed_mode/content_pack_2/site_list.json b/chrome/test/data/extensions/managed_mode/content_pack_2/site_list.json new file mode 100644 index 0000000..dd90763 --- /dev/null +++ b/chrome/test/data/extensions/managed_mode/content_pack_2/site_list.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "sites": [ + { + "name": "Moose", + "whitelist": [ + "moose.org" + ] + } + ] +} |