toolkit/devtools/server/tests/unit/test_objectgrips-08.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 var gDebuggee;
     5 var gClient;
     6 var gThreadClient;
     8 function run_test()
     9 {
    10   initTestDebuggerServer();
    11   gDebuggee = addTestGlobal("test-grips");
    12   gDebuggee.eval(function stopMe(arg1) {
    13     debugger;
    14   }.toString());
    16   gClient = new DebuggerClient(DebuggerServer.connectPipe());
    17   gClient.connect(function() {
    18     attachTestTabAndResume(gClient, "test-grips", function(aResponse, aTabClient, aThreadClient) {
    19       gThreadClient = aThreadClient;
    20       test_object_grip();
    21     });
    22   });
    23   do_test_pending();
    24 }
    26 function test_object_grip()
    27 {
    28   gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) {
    29     let args = aPacket.frame.arguments;
    31     do_check_eq(args[0].class, "Object");
    33     let objClient = gThreadClient.pauseGrip(args[0]);
    34     objClient.getPrototypeAndProperties(function(aResponse) {
    35       do_check_eq(aResponse.ownProperties.a.configurable, true);
    36       do_check_eq(aResponse.ownProperties.a.enumerable, true);
    37       do_check_eq(aResponse.ownProperties.a.writable, true);
    38       do_check_eq(aResponse.ownProperties.a.value.type, "Infinity");
    40       do_check_eq(aResponse.ownProperties.b.configurable, true);
    41       do_check_eq(aResponse.ownProperties.b.enumerable, true);
    42       do_check_eq(aResponse.ownProperties.b.writable, true);
    43       do_check_eq(aResponse.ownProperties.b.value.type, "-Infinity");
    45       do_check_eq(aResponse.ownProperties.c.configurable, true);
    46       do_check_eq(aResponse.ownProperties.c.enumerable, true);
    47       do_check_eq(aResponse.ownProperties.c.writable, true);
    48       do_check_eq(aResponse.ownProperties.c.value.type, "NaN");
    50       do_check_eq(aResponse.ownProperties.d.configurable, true);
    51       do_check_eq(aResponse.ownProperties.d.enumerable, true);
    52       do_check_eq(aResponse.ownProperties.d.writable, true);
    53       do_check_eq(aResponse.ownProperties.d.value.type, "-0");
    55       gThreadClient.resume(function() {
    56         finishClient(gClient);
    57       });
    58     });
    59   });
    61   gDebuggee.eval("stopMe({ a: Infinity, b: -Infinity, c: NaN, d: -0 })");
    62 }

mercurial