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

Unified Diff: LayoutTests/fast/dom/HTMLImageElement/image-sizes-1x.html

Issue 290803002: Return an absolute URL for HTMLImageElement.currentSrc (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test that currentSrc is absolute Created 6 years, 7 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: LayoutTests/fast/dom/HTMLImageElement/image-sizes-1x.html
diff --git a/LayoutTests/fast/dom/HTMLImageElement/image-sizes-1x.html b/LayoutTests/fast/dom/HTMLImageElement/image-sizes-1x.html
index cd39e588c29d1830a6eca5e93cc6f58616d88d44..bdee1e38978676b878a22d2eb1ee78a0d0e1e886 100644
--- a/LayoutTests/fast/dom/HTMLImageElement/image-sizes-1x.html
+++ b/LayoutTests/fast/dom/HTMLImageElement/image-sizes-1x.html
@@ -1,37 +1,39 @@
<html>
esprehn 2014/05/20 06:56:04 These tests all need doctypes. <!DOCTYPE html>. w
<head>
<script src="../../../resources/js-test.js"></script>
+<script src="resources/currentSrcHelper.js"></script>
<script>
if (window.testRunner)
testRunner.dumpAsText();
addEventListener("load", function() {
esprehn 2014/05/20 06:56:04 onload = function() { is usually preferred.
+ shouldBeTrue('document.getElementById("simple").currentSrc.indexOf("file://") == 0');
shouldBe('document.getElementById("simple").clientWidth', '(window.innerWidth)');
- shouldBe('document.getElementById("simple").currentSrc', '"../../hidpi/resources/image-set-2x.png"');
+ shouldBe('currentSrcFileName("simple")', '"image-set-2x.png"');
shouldBe('document.getElementById("small_sizes").clientWidth', '300');
- shouldBe('document.getElementById("small_sizes").currentSrc', '"../../hidpi/resources/image-set-1x.png"');
+ shouldBe('currentSrcFileName("small_sizes")', '"image-set-1x.png"');
shouldBe('document.getElementById("sizes_x_descriptors").clientWidth', '400');
- shouldBe('document.getElementById("sizes_x_descriptors").currentSrc', '"../../hidpi/resources/image-set-1x.png"');
+ shouldBe('currentSrcFileName("sizes_x_descriptors")', '"image-set-1x.png"');
shouldBe('document.getElementById("sizes_src").clientWidth', '400');
- shouldBe('document.getElementById("sizes_src").currentSrc', '"../../hidpi/resources/image-set-1x.png"');
+ shouldBe('currentSrcFileName("sizes_src")', '"image-set-1x.png"');
shouldBe('document.getElementById("default_sizes").clientWidth', 'window.innerWidth');
- shouldBe('document.getElementById("default_sizes").currentSrc', '"../../hidpi/resources/image-set-2x.png"');
+ shouldBe('currentSrcFileName("default_sizes")', '"image-set-2x.png"');
shouldBe('document.getElementById("invalid_length").clientWidth', 'window.innerWidth');
- shouldBe('document.getElementById("invalid_length").currentSrc', '"../../hidpi/resources/image-set-2x.png"');
+ shouldBe('currentSrcFileName("invalid_length")', '"image-set-2x.png"');
shouldBeCloseTo('document.getElementById("src_and_w").clientWidth', 700, 1/64);
- shouldBe('document.getElementById("src_and_w").currentSrc', '"resources/image-set-4x.png"');
+ shouldBe('currentSrcFileName("src_and_w")', '"image-set-4x.png"');
shouldBeCloseTo('document.getElementById("src_and_w2").clientWidth', 700, 1/64);
- shouldBe('document.getElementById("src_and_w2").currentSrc', '"../../hidpi/resources/image-set-1x.png"');
+ shouldBe('currentSrcFileName("src_and_w2")', '"image-set-1x.png"');
shouldBeCloseTo('document.getElementById("x_and_w").clientWidth', 700, 1/64);
- shouldBe('document.getElementById("x_and_w").currentSrc', '"resources/image-set-4x.png"');
+ shouldBe('currentSrcFileName("x_and_w")', '"image-set-4x.png"');
shouldBe('document.getElementById("x_and_w2").clientWidth', '400');
- shouldBe('document.getElementById("x_and_w2").currentSrc', '"../../hidpi/resources/image-set-2x.png"');
+ shouldBe('currentSrcFileName("x_and_w2")', '"image-set-2x.png"');
shouldBe('document.getElementById("x_and_w3").clientWidth', '400');
- shouldBe('document.getElementById("x_and_w3").currentSrc', '"../../hidpi/resources/image-set-2x.png"');
+ shouldBe('currentSrcFileName("x_and_w3")', '"image-set-2x.png"');
shouldBe('document.getElementById("half_size").clientWidth', '(window.innerWidth/2)');
- shouldBe('document.getElementById("half_size").currentSrc', '"../../hidpi/resources/image-set-2x.png"');
+ shouldBe('currentSrcFileName("half_size")', '"image-set-2x.png"');
shouldBe('document.getElementById("infitisimal_sizes").clientWidth', '(window.innerWidth/100)');
- shouldBe('document.getElementById("infitisimal_sizes").currentSrc', '"../../hidpi/resources/image-set-2x.png"');
+ shouldBe('currentSrcFileName("infitisimal_sizes")', '"image-set-2x.png"');
}, false);
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698