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

Unified Diff: chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc

Issue 2489853004: Parameterizing tests to cover cross-site and same-site subframes. (Closed)
Patch Set: Rebasing... Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
diff --git a/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc b/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
index 90dd858d20dfe3a354fb5378d6e5b3a23a394a9c..05cc4a8418e18f016d09da7205b4d44d1a2dffc3 100644
--- a/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
+++ b/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
@@ -379,7 +379,8 @@ const char kTestPagePath[] = "/drag_and_drop/page.html";
} // namespace
-class DragAndDropBrowserTest : public InProcessBrowserTest {
+class DragAndDropBrowserTest : public InProcessBrowserTest,
+ public testing::WithParamInterface<bool> {
public:
DragAndDropBrowserTest(){};
@@ -391,6 +392,11 @@ class DragAndDropBrowserTest : public InProcessBrowserTest {
drag_simulator_.reset(new DragAndDropSimulator(web_contents()));
}
+ bool use_cross_site_subframe() {
+ // This is controlled by gtest's test param from INSTANTIATE_TEST_CASE_P.
+ return GetParam();
+ }
+
content::RenderFrameHost* left_frame() {
AssertTestPageIsLoaded();
return GetFrameByName("left");
@@ -558,9 +564,10 @@ class DragAndDropBrowserTest : public InProcessBrowserTest {
DISALLOW_COPY_AND_ASSIGN(DragAndDropBrowserTest);
};
-IN_PROC_BROWSER_TEST_F(DragAndDropBrowserTest, DropTextFromOutside) {
+IN_PROC_BROWSER_TEST_P(DragAndDropBrowserTest, DropTextFromOutside) {
+ std::string frame_site = use_cross_site_subframe() ? "b.com" : "a.com";
ASSERT_TRUE(NavigateToTestPage("a.com"));
- ASSERT_TRUE(NavigateRightFrame("b.com", "drop_target.html"));
+ ASSERT_TRUE(NavigateRightFrame(frame_site, "drop_target.html"));
// Setup test expectations.
DOMDragEventVerifier expected_dom_event_data;
@@ -589,8 +596,8 @@ IN_PROC_BROWSER_TEST_F(DragAndDropBrowserTest, DropTextFromOutside) {
}
}
-IN_PROC_BROWSER_TEST_F(DragAndDropBrowserTest, DragStartInFrame) {
- std::string frame_site = "b.com";
+IN_PROC_BROWSER_TEST_P(DragAndDropBrowserTest, DragStartInFrame) {
+ std::string frame_site = use_cross_site_subframe() ? "b.com" : "a.com";
ASSERT_TRUE(NavigateToTestPage("a.com"));
ASSERT_TRUE(NavigateLeftFrame(frame_site, "image_source.html"));
@@ -639,4 +646,10 @@ IN_PROC_BROWSER_TEST_F(DragAndDropBrowserTest, DragStartInFrame) {
SimulateMouseUp();
}
+INSTANTIATE_TEST_CASE_P(
+ SameSiteSubframe, DragAndDropBrowserTest, ::testing::Values(false));
+
+INSTANTIATE_TEST_CASE_P(
+ CrossSiteSubframe, DragAndDropBrowserTest, ::testing::Values(true));
+
} // namespace chrome
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698