Index: chrome/test/data/webui/position_util_test.html |
diff --git a/ui/webui/resources/js/cr/ui/position_util_test.html b/chrome/test/data/webui/position_util_test.html |
similarity index 93% |
rename from ui/webui/resources/js/cr/ui/position_util_test.html |
rename to chrome/test/data/webui/position_util_test.html |
index 5fcc6c142766c7061dd0fcfb4b5022afda63e98c..84ec0509efbc00d1bcdf441df2d975075a8d7b23 100644 |
--- a/ui/webui/resources/js/cr/ui/position_util_test.html |
+++ b/chrome/test/data/webui/position_util_test.html |
@@ -1,17 +1,7 @@ |
<!DOCTYPE html> |
<html> |
<head> |
-<!-- TODO(arv): Check in Closue unit tests and make this run as part of the |
- tests --> |
-<script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.js"></script> |
-<script src="../../cr.js"></script> |
-<script src="position_util.js"></script> |
-<script> |
- |
-goog.require('goog.testing.PropertyReplacer'); |
-goog.require('goog.testing.jsunit'); |
- |
-</script> |
+<script src="webui_resource_test.js"></script> |
<style> |
html, body { |
@@ -48,7 +38,7 @@ html, body { |
var anchor = document.getElementById('anchor'); |
var popup = document.getElementById('popup'); |
var anchorParent = anchor.offsetParent; |
-var pr = new goog.testing.PropertyReplacer; |
Dan Beam
2013/06/20 17:57:46
propertyreplacer is fancier :(
kevers
2013/06/20 18:41:37
Can certainly add it if you'd like. The last of t
Dan Beam
2013/06/20 18:42:20
whatever you'd like, i've just found it handy in t
|
+var oldGetBoundingClientRect = anchorParent.getBoundingClientRect; |
var availRect; |
function MockRect(w, h) { |
@@ -66,14 +56,14 @@ function setUp() { |
anchor.style.top = '100px'; |
anchor.style.left = '100px'; |
availRect = new MockRect(200, 200); |
- pr.set(anchorParent, 'getBoundingClientRect', function() { |
+ anchorParent.getBoundingClientRect = function() { |
return availRect; |
- }); |
+ }; |
} |
function tearDown() { |
document.documentElement.dir = 'ltr'; |
- pr.reset(); |
+ anchorParent.getBoundingClientRect = oldGetBoundingClientRect; |
} |
function testAbovePrimary() { |