Commit f32426ea authored by David Grogan's avatar David Grogan Committed by Commit Bot

Improve NTP browser test error messages

This test fails with LayoutNG's flexbox implementation and I'm trying to
figure out why.

As is, when it fails on the bots, it says the following, whose "Actual"
is uninformative.

 [12496:12496:0214/021305.769266:ERROR:CONSOLE(565)] "Refused to frame 'https://www.chromium.org/' because it violates the following Content Security Policy directive: "child-src chrome-search://most-visited/ https://*.google.com/". Note that 'frame-src' was not explicitly set, so 'child-src' is used as a fallback.
 ", source: chrome-search://local-ntp/doodles.js (565)
 ../../chrome/browser/ui/search/local_ntp_doodle_browsertest.cc:1438: Failure
 Value of: GetDimension(active_tab, searchbox(), "top")

 Expected: is equal to 474
   Actual: 8-byte object <01-00 00-00 26-01 00-00>
 Stack trace:
 #0 0x558beae4a9fe LocalNTPDoodleTest_ShouldMoveFakeboxWhenIframeResized_Test::RunTestOnMainThread()

Change-Id: I0e9a0029ac8f04ca21b7df934cff4e052896e413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2057639Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Commit-Queue: David Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742434}
parent 2a3d0d8a
......@@ -1413,10 +1413,11 @@ IN_PROC_BROWSER_TEST_F(LocalNTPDoodleTest, ShouldMoveFakeboxWhenIframeResized) {
ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL));
// Initial dimensions are correct:
EXPECT_THAT(GetDimension(active_tab, searchbox(), "top"),
EXPECT_THAT(*GetDimension(active_tab, searchbox(), "top"),
Eq(kSearchboxTopPx));
EXPECT_THAT(GetDimension(active_tab, "logo-doodle-iframe", "width"), Eq(400));
EXPECT_THAT(GetDimension(active_tab, "logo-doodle-iframe", "height"),
EXPECT_THAT(*GetDimension(active_tab, "logo-doodle-iframe", "width"),
Eq(400));
EXPECT_THAT(*GetDimension(active_tab, "logo-doodle-iframe", "height"),
Eq(220));
// Trigger resize. The duration parameter is left untested, since that would
......@@ -1434,11 +1435,11 @@ IN_PROC_BROWSER_TEST_F(LocalNTPDoodleTest, ShouldMoveFakeboxWhenIframeResized) {
)js"));
// Fakebox is now 180px lower, with the iframe larger, as requested.
EXPECT_THAT(GetDimension(active_tab, searchbox(), "top"),
EXPECT_THAT(*GetDimension(active_tab, searchbox(), "top"),
Eq(kSearchboxTopPx + 180));
EXPECT_THAT(GetDimension(active_tab, "logo-doodle-iframe", "width"),
Eq(GetDimension(active_tab, "logo", "width")));
EXPECT_THAT(GetDimension(active_tab, "logo-doodle-iframe", "height"),
EXPECT_THAT(*GetDimension(active_tab, "logo-doodle-iframe", "width"),
Eq(*GetDimension(active_tab, "logo", "width")));
EXPECT_THAT(*GetDimension(active_tab, "logo-doodle-iframe", "height"),
Eq(400));
ASSERT_TRUE(content::ExecuteScript(active_tab,
......@@ -1452,10 +1453,11 @@ IN_PROC_BROWSER_TEST_F(LocalNTPDoodleTest, ShouldMoveFakeboxWhenIframeResized) {
)js"));
// Back to the original dimensions now.
EXPECT_THAT(GetDimension(active_tab, searchbox(), "top"),
EXPECT_THAT(*GetDimension(active_tab, searchbox(), "top"),
Eq(kSearchboxTopPx));
EXPECT_THAT(GetDimension(active_tab, "logo-doodle-iframe", "width"), Eq(400));
EXPECT_THAT(GetDimension(active_tab, "logo-doodle-iframe", "height"),
EXPECT_THAT(*GetDimension(active_tab, "logo-doodle-iframe", "width"),
Eq(400));
EXPECT_THAT(*GetDimension(active_tab, "logo-doodle-iframe", "height"),
Eq(220));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment