diff options
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/positioning/anchoredposition_test.html')
-rw-r--r-- | contexts/data/lib/closure-library/closure/goog/positioning/anchoredposition_test.html | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/positioning/anchoredposition_test.html b/contexts/data/lib/closure-library/closure/goog/positioning/anchoredposition_test.html deleted file mode 100644 index 08b996f..0000000 --- a/contexts/data/lib/closure-library/closure/goog/positioning/anchoredposition_test.html +++ /dev/null @@ -1,77 +0,0 @@ -<!DOCTYPE HTML> -<!-- - ---> -<html> -<!-- -Copyright 2011 The Closure Library Authors. All Rights Reserved. - -Use of this source code is governed by the Apache License, Version 2.0. -See the COPYING file for details. ---> -<head> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<title>Closure Unit Tests - goog.positioning.AnchoredPosition</title> -<script src="../base.js"></script> -<script> -goog.require('goog.dom'); -goog.require('goog.positioning.AnchoredPosition'); -goog.require('goog.style'); -goog.require('goog.testing.jsunit'); -</script> -</head> -<body> -<!-- Use IFRAME to avoid non-deterministic window size problems in Selenium. --> -<iframe id="frame1" style="width:200px; height:200px;" - src="anchoredviewportposition_test_iframe.html"> -</iframe> -<script> -var frame, doc, dom, viewportSize, anchor, popup; -var corner = goog.positioning.Corner; -var popupLength = 20; -var anchorLength = 100; - -function setUp() { - frame = document.getElementById('frame1'); - doc = goog.dom.getFrameContentDocument(frame); - dom = goog.dom.getDomHelper(doc); - viewportSize = dom.getViewportSize(); - anchor = dom.getElement('anchor'); - popup = dom.getElement('popup'); - goog.style.setSize(popup, popupLength, popupLength); - goog.style.setPosition(popup, popupLength, popupLength); - goog.style.setSize(anchor, anchorLength, anchorLength); -} - -// No enough space at the bottom and no overflow adjustment. -function testRepositionWithDefaultOverflow() { - var avp = new goog.positioning.AnchoredPosition( - anchor, corner.BOTTOM_LEFT); - var newTop = viewportSize.height - anchorLength; - goog.style.setPosition(anchor, 50, newTop); - var anchorRect = goog.style.getBounds(anchor); - - avp.reposition(popup, corner.TOP_LEFT); - var popupRect = goog.style.getBounds(popup); - assertEquals(anchorRect.top + anchorRect.height, popupRect.top); -} - -// No enough space at the bottom and ADJUST_Y overflow adjustment. -function testRepositionWithOverflow() { - var avp = new goog.positioning.AnchoredPosition( - anchor, corner.BOTTOM_LEFT, - goog.positioning.Overflow.ADJUST_Y); - var newTop = viewportSize.height - anchorLength; - goog.style.setPosition(anchor, 50, newTop); - var anchorRect = goog.style.getBounds(anchor); - - avp.reposition(popup, corner.TOP_LEFT); - var popupRect = goog.style.getBounds(popup); - assertEquals(anchorRect.top + anchorRect.height, - popupRect.top + popupRect.height); -} - -</script> -</body> -</html> - |