Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / window_open / argument_overflow / test.js
blob0b99bc262c0036f081a7d780c7c2e8e1fd7bec24
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 function check_overflow_check(value) {
6 try {
7 chrome.windows.create({ "left": value }, function() { });
8 } catch (e) {
9 chrome.test.assertTrue(e.message.indexOf(
10 "Value must fit in a 32-bit signed integer.") != -1);
11 chrome.test.succeed();
12 return;
15 chrome.test.runTests([
16 function overflow2To31() { check_overflow_check(0x80000000); },
17 function overflowMinus2To31Minus1() { check_overflow_check(-0x80000001); },
18 function overflow2To32() { check_overflow_check(0x100000000); },
19 ]);