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

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

Issue 7432006: Add an experimental permissions API for extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/extensions/extension_service_unittest.h" 5 #include "chrome/browser/extensions/extension_service_unittest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 scripts[1].js_scripts()[0].extension_root(), 1017 scripts[1].js_scripts()[0].extension_root(),
1018 scripts[1].js_scripts()[0].relative_path()); 1018 scripts[1].js_scripts()[0].relative_path());
1019 expected_path = 1019 expected_path =
1020 extension->path().AppendASCII("js_files").AppendASCII("script3.js"); 1020 extension->path().AppendASCII("js_files").AppendASCII("script3.js");
1021 ASSERT_TRUE(file_util::AbsolutePath(&expected_path)); 1021 ASSERT_TRUE(file_util::AbsolutePath(&expected_path));
1022 EXPECT_TRUE(resource10.ComparePathWithDefault(expected_path)); 1022 EXPECT_TRUE(resource10.ComparePathWithDefault(expected_path));
1023 1023
1024 expected_patterns.ClearPatterns(); 1024 expected_patterns.ClearPatterns();
1025 AddPattern(&expected_patterns, "http://*.google.com/*"); 1025 AddPattern(&expected_patterns, "http://*.google.com/*");
1026 AddPattern(&expected_patterns, "https://*.google.com/*"); 1026 AddPattern(&expected_patterns, "https://*.google.com/*");
1027 EXPECT_EQ(expected_patterns, extension->permission_set()->explicit_hosts()); 1027 EXPECT_EQ(expected_patterns,
1028 extension->GetActivePermissions()->explicit_hosts());
1028 1029
1029 EXPECT_EQ(std::string(good1), loaded_[1]->id()); 1030 EXPECT_EQ(std::string(good1), loaded_[1]->id());
1030 EXPECT_EQ(std::string("My extension 2"), loaded_[1]->name()); 1031 EXPECT_EQ(std::string("My extension 2"), loaded_[1]->name());
1031 EXPECT_EQ(std::string(""), loaded_[1]->description()); 1032 EXPECT_EQ(std::string(""), loaded_[1]->description());
1032 EXPECT_EQ(loaded_[1]->GetResourceURL("background.html"), 1033 EXPECT_EQ(loaded_[1]->GetResourceURL("background.html"),
1033 loaded_[1]->background_url()); 1034 loaded_[1]->background_url());
1034 EXPECT_EQ(0u, loaded_[1]->content_scripts().size()); 1035 EXPECT_EQ(0u, loaded_[1]->content_scripts().size());
1035 // We don't parse the plugins section on Chrome OS. 1036 // We don't parse the plugins section on Chrome OS.
1036 #if defined(OS_CHROMEOS) 1037 #if defined(OS_CHROMEOS)
1037 EXPECT_EQ(0u, loaded_[1]->plugins().size()); 1038 EXPECT_EQ(0u, loaded_[1]->plugins().size());
(...skipping 2756 matching lines...) Expand 10 before | Expand all | Expand 10 after
3794 ASSERT_FALSE(AddPendingSyncInstall()); 3795 ASSERT_FALSE(AddPendingSyncInstall());
3795 3796
3796 // Wait for the external source to install. 3797 // Wait for the external source to install.
3797 WaitForCrxInstall(crx_path_, true); 3798 WaitForCrxInstall(crx_path_, true);
3798 ASSERT_TRUE(IsCrxInstalled()); 3799 ASSERT_TRUE(IsCrxInstalled());
3799 3800
3800 // Now that the extension is installed, sync request should fail 3801 // Now that the extension is installed, sync request should fail
3801 // because the extension is already installed. 3802 // because the extension is already installed.
3802 ASSERT_FALSE(AddPendingSyncInstall()); 3803 ASSERT_FALSE(AddPendingSyncInstall());
3803 } 3804 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698