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

Unified Diff: content/renderer/peripheral_content_heuristic_unittest.cc

Issue 2627493002: [PPS] Exclude same-origin tiny plugins. (Closed)
Patch Set: fix test Created 3 years, 11 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
Index: content/renderer/peripheral_content_heuristic_unittest.cc
diff --git a/content/renderer/peripheral_content_heuristic_unittest.cc b/content/renderer/peripheral_content_heuristic_unittest.cc
index 57396a7688b3dde59598f08d6864a73d32762cfc..f65cde75abe546c7df85c3bfcd7bf8092ca03f1e 100644
--- a/content/renderer/peripheral_content_heuristic_unittest.cc
+++ b/content/renderer/peripheral_content_heuristic_unittest.cc
@@ -4,6 +4,8 @@
#include "content/renderer/peripheral_content_heuristic.h"
+#include "base/test/scoped_feature_list.h"
+#include "content/public/common/content_features.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/size.h"
#include "url/gurl.h"
@@ -59,6 +61,16 @@ TEST(PeripheralContentHeuristic, TinyContent) {
url::Origin(GURL(kOtherOrigin)), gfx::Size(10, 10)));
}
+TEST(PeripheralContentHeuristic, FilterSameOriginTinyPlugins) {
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndEnableFeature(features::kFilterSameOriginTinyPlugin);
+
+ EXPECT_EQ(RenderFrame::CONTENT_STATUS_TINY,
+ PeripheralContentHeuristic::GetPeripheralStatus(
+ std::set<url::Origin>(), url::Origin(GURL(kSameOrigin)),
+ url::Origin(GURL(kSameOrigin)), gfx::Size(1, 1)));
+}
+
TEST(PeripheralContentHeuristic, TemporaryOriginWhitelist) {
EXPECT_EQ(RenderFrame::CONTENT_STATUS_PERIPHERAL,
PeripheralContentHeuristic::GetPeripheralStatus(

Powered by Google App Engine
This is Rietveld 408576698