| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var callbackPass = chrome.test.callbackPass; | 5 var callbackPass = chrome.test.callbackPass; |
| 6 var callbackFail = chrome.test.callbackFail; | 6 var callbackFail = chrome.test.callbackFail; |
| 7 var defaultFuzzFactor = 1; | 7 var defaultFuzzFactor = 1; |
| 8 | 8 |
| 9 function assertFuzzyEq(expected, actual, fuzzFactor, message) { | 9 function assertFuzzyEq(expected, actual, fuzzFactor, message) { |
| 10 if (!message) { | 10 if (!message) { |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 innerBounds: innerBounds | 392 innerBounds: innerBounds |
| 393 }, callbackPass(function(win) { | 393 }, callbackPass(function(win) { |
| 394 chrome.test.assertTrue(win != null); | 394 chrome.test.assertTrue(win != null); |
| 395 assertBoundsEq(innerBounds, win.innerBounds); | 395 assertBoundsEq(innerBounds, win.innerBounds); |
| 396 assertBoundsConsistent(win); | 396 assertBoundsConsistent(win); |
| 397 assertConstraintsUnspecified(win); | 397 assertConstraintsUnspecified(win); |
| 398 win.close(); | 398 win.close(); |
| 399 })); | 399 })); |
| 400 }, | 400 }, |
| 401 | 401 |
| 402 // Regression for crbug.com/694248. |
| 403 function testInnerBoundsNegativeZero() { |
| 404 var innerBounds = { |
| 405 left: -0, |
| 406 top: 100, |
| 407 width: 400, |
| 408 height: 300, |
| 409 }; |
| 410 chrome.app.window.create('test.html', { |
| 411 innerBounds: innerBounds |
| 412 }, callbackPass(function(win) { |
| 413 chrome.test.assertTrue(win != null); |
| 414 assertBoundsEq(innerBounds, win.innerBounds); |
| 415 assertBoundsConsistent(win); |
| 416 assertConstraintsUnspecified(win); |
| 417 win.close(); |
| 418 })); |
| 419 }, |
| 420 |
| 402 function testOuterBoundsOnly() { | 421 function testOuterBoundsOnly() { |
| 403 var outerBounds = { | 422 var outerBounds = { |
| 404 left: 150, | 423 left: 150, |
| 405 top: 100, | 424 top: 100, |
| 406 width: 400, | 425 width: 400, |
| 407 height: 300 | 426 height: 300 |
| 408 }; | 427 }; |
| 409 chrome.app.window.create('test.html', { | 428 chrome.app.window.create('test.html', { |
| 410 outerBounds: outerBounds | 429 outerBounds: outerBounds |
| 411 }, callbackPass(function(win) { | 430 }, callbackPass(function(win) { |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1401 })); | 1420 })); |
| 1402 }, | 1421 }, |
| 1403 ]); | 1422 ]); |
| 1404 } | 1423 } |
| 1405 | 1424 |
| 1406 chrome.app.runtime.onLaunched.addListener(function() { | 1425 chrome.app.runtime.onLaunched.addListener(function() { |
| 1407 chrome.test.sendMessage('Launched', function(reply) { | 1426 chrome.test.sendMessage('Launched', function(reply) { |
| 1408 window[reply](); | 1427 window[reply](); |
| 1409 }); | 1428 }); |
| 1410 }); | 1429 }); |
| OLD | NEW |