js/src/tests/js1_5/extensions/regress-564577.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /*
michael@0 3 * Any copyright is dedicated to the Public Domain.
michael@0 4 * http://creativecommons.org/licenses/publicdomain/
michael@0 5 * Contributor: Matthew Draper <matthew@trebex.net>
michael@0 6 */
michael@0 7
michael@0 8 var gTestfile = 'regress-564577.js';
michael@0 9 //-----------------------------------------------------------------------------
michael@0 10 var BUGNUMBER = 564577;
michael@0 11 var summary = '__noSuchMethod__ when property exists';
michael@0 12 var actual = '';
michael@0 13 var expect = '';
michael@0 14
michael@0 15
michael@0 16 //-----------------------------------------------------------------------------
michael@0 17 test();
michael@0 18 //-----------------------------------------------------------------------------
michael@0 19
michael@0 20 function test()
michael@0 21 {
michael@0 22 enterFunc ('test');
michael@0 23 printBugNumber(BUGNUMBER);
michael@0 24 printStatus (summary);
michael@0 25
michael@0 26
michael@0 27 var o = {
michael@0 28 aaa: undefined,
michael@0 29 bbb: null,
michael@0 30 ccc: 77,
michael@0 31 ddd: 'foo',
michael@0 32 eee: {},
michael@0 33 fff: /./,
michael@0 34 __noSuchMethod__: function (id, args)
michael@0 35 {
michael@0 36 return(id + '('+args.join(',')+') ' + this[id]);
michael@0 37 }
michael@0 38 };
michael@0 39
michael@0 40 status = summary + ' ' + inSection(1) + ' ';
michael@0 41 actual = o.aaa();
michael@0 42 expect = 'aaa() undefined';
michael@0 43 reportCompare(expect, actual, status);
michael@0 44
michael@0 45 status = summary + ' ' + inSection(2) + ' ';
michael@0 46 try {
michael@0 47 actual = o.bbb();
michael@0 48 } catch(e) {
michael@0 49 actual = e + '';
michael@0 50 }
michael@0 51 expect = 'TypeError: o.bbb is not a function';
michael@0 52 reportCompare(expect, actual, status);
michael@0 53
michael@0 54 status = summary + ' ' + inSection(3) + ' ';
michael@0 55 try {
michael@0 56 actual = o.ccc();
michael@0 57 } catch(e) {
michael@0 58 actual = e + '';
michael@0 59 }
michael@0 60 expect = 'TypeError: o.ccc is not a function';
michael@0 61 reportCompare(expect, actual, status);
michael@0 62
michael@0 63 status = summary + ' ' + inSection(4) + ' ';
michael@0 64 try {
michael@0 65 actual = o.ddd();
michael@0 66 } catch(e) {
michael@0 67 actual = e + '';
michael@0 68 }
michael@0 69 expect = 'TypeError: o.ddd is not a function';
michael@0 70 reportCompare(expect, actual, status);
michael@0 71
michael@0 72 status = summary + ' ' + inSection(5) + ' ';
michael@0 73 try {
michael@0 74 actual = o.eee();
michael@0 75 } catch(e) {
michael@0 76 actual = e + '';
michael@0 77 }
michael@0 78 expect = 'TypeError: o.eee is not a function';
michael@0 79 reportCompare(expect, actual, status);
michael@0 80
michael@0 81 status = summary + ' ' + inSection(6) + ' ';
michael@0 82 try {
michael@0 83 actual = o.fff('xyz') + '';
michael@0 84 } catch(e) {
michael@0 85 actual = e + '';
michael@0 86 }
michael@0 87 expect = 'TypeError: o.fff is not a function';
michael@0 88 reportCompare(expect, actual, status);
michael@0 89
michael@0 90 exitFunc('test');
michael@0 91 }

mercurial