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

Unified Diff: chrome/test/data/webui/position_util_test.html

Issue 17315020: Port passing closure tests for cr.ui framework to browser tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer feedback fixes. Created 7 years, 6 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: 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() {

Powered by Google App Engine
This is Rietveld 408576698