Commit 15329dc3 authored by rajendrant's avatar rajendrant Committed by Commit Bot

Add test for pseudo background image lazyload

Bug: 932634
Change-Id: Icb5009f436181c1686885dbbfea724dc8a67b77a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1522926Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: rajendrant <rajendrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642374}
parent ef3fbbf0
......@@ -43,3 +43,20 @@ IN_PROC_BROWSER_TEST_F(LazyLoadBrowserTest, CSSBackgroundImageDeferred) {
// TODO(rajendrant): Add a test that checks if the deferred image is loaded when
// user scrolls near it.
IN_PROC_BROWSER_TEST_F(LazyLoadBrowserTest, CSSPseudoBackgroundImageLoaded) {
ASSERT_TRUE(embedded_test_server()->Start());
base::HistogramTester histogram_tester;
ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(
"/lazyload/css-pseudo-background-image.html"));
base::RunLoop().RunUntilIdle();
// Navigate away to finish the histogram recording.
ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL));
// Verify that the image bucket has substantial kilobytes recorded.
EXPECT_GE(30 /* KB */, histogram_tester.GetBucketCount(
"DataUse.ContentType.UserTrafficKB",
data_use_measurement::DataUseUserData::IMAGE));
}
<!DOCTYPE html>
<html>
<style>
body::before {
position: absolute;
width: 100%;
height: 100%;
background-image: url("images/fruit1.jpg");
}
</style>
<body>
</body>
</html>
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