js/src/tests/ecma_2/Statements/switch-003.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 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6
michael@0 7 /**
michael@0 8 * File Name: switch-003.js
michael@0 9 * ECMA Section:
michael@0 10 * Description: The switch Statement
michael@0 11 *
michael@0 12 * Attempt to verify that case statements are evaluated in source order
michael@0 13 *
michael@0 14 * Author: christine@netscape.com
michael@0 15 * Date: 11 August 1998
michael@0 16 *
michael@0 17 */
michael@0 18 var SECTION = "switch-003";
michael@0 19 var VERSION = "ECMA_2";
michael@0 20 var TITLE = "The switch statement";
michael@0 21
michael@0 22 startTest();
michael@0 23 writeHeaderToLog( SECTION + " "+ TITLE);
michael@0 24
michael@0 25 SwitchTest( "a", "abc" );
michael@0 26 SwitchTest( "b", "bc" );
michael@0 27 SwitchTest( "c", "c" );
michael@0 28 SwitchTest( "d", "*abc" );
michael@0 29 SwitchTest( "v", "*abc" );
michael@0 30 SwitchTest( "w", "w*abc" );
michael@0 31 SwitchTest( "x", "xw*abc" );
michael@0 32 SwitchTest( "y", "yxw*abc" );
michael@0 33 SwitchTest( "z", "zyxw*abc" );
michael@0 34 // SwitchTest( new java.lang.String("z"), "*abc" );
michael@0 35
michael@0 36 test();
michael@0 37
michael@0 38 function SwitchTest( input, expect ) {
michael@0 39 var result = "";
michael@0 40
michael@0 41 switch ( input ) {
michael@0 42 case "z": result += "z";
michael@0 43 case "y": result += "y";
michael@0 44 case "x": result += "x";
michael@0 45 case "w": result += "w";
michael@0 46 default: result += "*";
michael@0 47 case "a": result += "a";
michael@0 48 case "b": result += "b";
michael@0 49 case "c": result += "c";
michael@0 50 }
michael@0 51
michael@0 52 new TestCase(
michael@0 53 SECTION,
michael@0 54 "switch with no breaks: input is " + input,
michael@0 55 expect,
michael@0 56 result );
michael@0 57 }

mercurial