tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_serialize.html (1103B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>object serialization</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/resources/channel.sub.js"></script>
      7 <script src="serialize-data.js"></script>
      8 
      9 <script>
     10 setup(() => {
     11    remote = new RemoteGlobal();
     12 
     13    let url = `serialize_child.html?uuid=${remote.uuid}`;
     14    win = window.open(url);
     15 });
     16 
     17 for (let [name, obj] of Object.entries(objects)) {
     18    promise_test(async t => {
     19        let result = await remote.call(
     20            (name, inputValue) => compareResult(name, inputValue),
     21            name,
     22            obj.input);
     23        assert_true(result);
     24    }, `Serialize ${name}`);
     25 }
     26 
     27 promise_test(async t => {
     28    let remoteValue = RemoteObject.from(document.head);
     29    let result = await remote.call(inputValue => {
     30        if (!(inputValue instanceof RemoteObject)) {
     31            throw new AssertionError(`Expected RemoteObject`);
     32        }
     33        return inputValue;
     34    }, remoteValue);
     35    assert_equals(result, document.head);
     36 }, "Serialize RemoteObject");
     37 
     38 </script>