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

Unified Diff: third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html

Issue 2560253004: IntersectionObserver: convert tests to testharness.js (Closed)
Patch Set: rebase Created 4 years 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: third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/intersection-observer/resources/cross-origin-subframe.html b/third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html
similarity index 76%
rename from third_party/WebKit/LayoutTests/http/tests/intersection-observer/resources/cross-origin-subframe.html
rename to third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html
index edf34dcd2a591c09c7d4cc213bf175104acaf8ad..bda1a8c17d91c99ebd7b2e60a41ee2bcdaf57864 100644
--- a/third_party/WebKit/LayoutTests/http/tests/intersection-observer/resources/cross-origin-subframe.html
+++ b/third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html
@@ -1,9 +1,42 @@
<!DOCTYPE html>
-<script src="/js-test-resources/intersection-observer-helper-functions.js"></script>
<div style="height: 200px; width: 100px;"></div>
<div id="target" style="background-color: green; width:100px; height:100px"></div>
<div style="height: 200px; width: 100px;"></div>
<script>
+function clientRectToJson(rect) {
+ if (!rect)
+ return null;
+ return {
+ top: rect.top,
+ right: rect.right,
+ bottom: rect.bottom,
+ left: rect.left,
+ width: rect.width,
+ height: rect.height
+ };
+}
+
+function coordinatesToClientRectJson(top, right, bottom, left) {
+ return {
+ top: top,
+ right: right,
+ bottom: bottom,
+ left: left,
+ width: right - left,
+ height: bottom - top
+ };
+}
+
+function entryToJson(entry) {
+ return {
+ boundingClientRect: clientRectToJson(entry.boundingClientRect),
+ intersectionRect: clientRectToJson(entry.intersectionRect),
+ rootBounds: clientRectToJson(entry.rootBounds),
+ time: entry.time,
+ target: entry.target.id
+ };
+}
+
var port;
var entries = [];
var target = document.getElementById('target');

Powered by Google App Engine
This is Rietveld 408576698