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

Unified Diff: chrome/browser/plugins/plugin_info_message_filter_unittest.cc

Issue 2378573005: [HBD] Blanket BLOCK on all non-HTTP(s) and non-FILE URLs for Flash. (Closed)
Patch Set: fix dat merge Created 4 years, 2 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/plugins/plugin_info_message_filter.cc ('k') | chrome/browser/plugins/plugin_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_info_message_filter_unittest.cc
diff --git a/chrome/browser/plugins/plugin_info_message_filter_unittest.cc b/chrome/browser/plugins/plugin_info_message_filter_unittest.cc
index 1fa4a104afccbaac4ae614a911a14cfa97946335..fe9f8620317e299303401bd580af38aa3700ee44 100644
--- a/chrome/browser/plugins/plugin_info_message_filter_unittest.cc
+++ b/chrome/browser/plugins/plugin_info_message_filter_unittest.cc
@@ -26,6 +26,7 @@
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "url/origin.h"
using content::PluginService;
@@ -45,7 +46,7 @@ class FakePluginServiceFilter : public content::PluginServiceFilter {
int render_view_id,
const void* context,
const GURL& url,
- const GURL& policy_url,
+ const url::Origin& main_frame_origin,
content::WebPluginInfo* plugin) override;
bool CanLoadPlugin(int render_process_id,
@@ -64,7 +65,7 @@ bool FakePluginServiceFilter::IsPluginAvailable(
int render_view_id,
const void* context,
const GURL& url,
- const GURL& policy_url,
+ const url::Origin& main_frame_origin,
content::WebPluginInfo* plugin) {
std::map<base::FilePath, bool>::iterator it =
plugin_state_.find(plugin->path);
@@ -151,9 +152,9 @@ class PluginInfoMessageFilterTest : public ::testing::Test {
base::ASCIIToUTF16(content::kFlashPluginName), base::FilePath(),
base::ASCIIToUTF16("1"), base::ASCIIToUTF16("Fake Flash"));
- PluginUtils::GetPluginContentSetting(host_content_settings_map_,
- plugin_info, url, url, plugin,
- &setting, &is_default, &is_managed);
+ PluginUtils::GetPluginContentSetting(
+ host_content_settings_map_, plugin_info, url::Origin(url), url, plugin,
+ &setting, &is_default, &is_managed);
EXPECT_EQ(expected_setting, setting);
EXPECT_EQ(expected_is_default, is_default);
EXPECT_EQ(expected_is_managed, is_managed);
@@ -178,9 +179,9 @@ TEST_F(PluginInfoMessageFilterTest, FindEnabledPlugin) {
ChromeViewHostMsg_GetPluginInfo_Status status;
content::WebPluginInfo plugin;
std::string actual_mime_type;
- EXPECT_TRUE(context()->FindEnabledPlugin(
- 0, GURL(), GURL(), "foo/bar", &status, &plugin, &actual_mime_type,
- NULL));
+ EXPECT_TRUE(context()->FindEnabledPlugin(0, GURL(), url::Origin(),
+ "foo/bar", &status, &plugin,
+ &actual_mime_type, NULL));
EXPECT_EQ(ChromeViewHostMsg_GetPluginInfo_Status::kAllowed, status);
EXPECT_EQ(foo_plugin_path_.value(), plugin.path.value());
}
@@ -190,9 +191,9 @@ TEST_F(PluginInfoMessageFilterTest, FindEnabledPlugin) {
ChromeViewHostMsg_GetPluginInfo_Status status;
content::WebPluginInfo plugin;
std::string actual_mime_type;
- EXPECT_TRUE(context()->FindEnabledPlugin(
- 0, GURL(), GURL(), "foo/bar", &status, &plugin, &actual_mime_type,
- NULL));
+ EXPECT_TRUE(context()->FindEnabledPlugin(0, GURL(), url::Origin(),
+ "foo/bar", &status, &plugin,
+ &actual_mime_type, NULL));
EXPECT_EQ(ChromeViewHostMsg_GetPluginInfo_Status::kAllowed, status);
EXPECT_EQ(bar_plugin_path_.value(), plugin.path.value());
}
@@ -204,9 +205,9 @@ TEST_F(PluginInfoMessageFilterTest, FindEnabledPlugin) {
std::string actual_mime_type;
std::string identifier;
base::string16 plugin_name;
- EXPECT_FALSE(context()->FindEnabledPlugin(
- 0, GURL(), GURL(), "foo/bar", &status, &plugin, &actual_mime_type,
- NULL));
+ EXPECT_FALSE(context()->FindEnabledPlugin(0, GURL(), url::Origin(),
+ "foo/bar", &status, &plugin,
+ &actual_mime_type, NULL));
EXPECT_EQ(ChromeViewHostMsg_GetPluginInfo_Status::kDisabled, status);
EXPECT_EQ(foo_plugin_path_.value(), plugin.path.value());
}
@@ -214,9 +215,9 @@ TEST_F(PluginInfoMessageFilterTest, FindEnabledPlugin) {
ChromeViewHostMsg_GetPluginInfo_Status status;
content::WebPluginInfo plugin;
std::string actual_mime_type;
- EXPECT_FALSE(context()->FindEnabledPlugin(
- 0, GURL(), GURL(), "baz/blurp", &status, &plugin, &actual_mime_type,
- NULL));
+ EXPECT_FALSE(context()->FindEnabledPlugin(0, GURL(), url::Origin(),
+ "baz/blurp", &status, &plugin,
+ &actual_mime_type, NULL));
EXPECT_EQ(ChromeViewHostMsg_GetPluginInfo_Status::kNotFound, status);
EXPECT_EQ(FILE_PATH_LITERAL(""), plugin.path.value());
}
« no previous file with comments | « chrome/browser/plugins/plugin_info_message_filter.cc ('k') | chrome/browser/plugins/plugin_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698