From d8741afa1c3f31723ec62131d1bb8a78081cd1e4 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 3 Mar 2016 10:15:30 -0800 Subject: Add JS tests for global const equality. Add these tests before fixing bug 419. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1761923002 . --- testing/resources/javascript/consts.in | 11 +++++++++++ testing/resources/javascript/consts_expected.txt | 4 ++++ 2 files changed, 15 insertions(+) (limited to 'testing') diff --git a/testing/resources/javascript/consts.in b/testing/resources/javascript/consts.in index a717ec873a..6fb82158e3 100644 --- a/testing/resources/javascript/consts.in +++ b/testing/resources/javascript/consts.in @@ -66,6 +66,16 @@ function doGlobalArrayTest(props) { } } +function doEqualityTests() { + app.alert("String equality test (==): " + + (IDS_GREATER_THAN == IDS_GREATER_THAN)); + app.alert("String equality test (===): " + + (IDS_GREATER_THAN === IDS_GREATER_THAN)); + app.alert("Array equality test (==): " + + (RE_PHONE_COMMIT == RE_PHONE_COMMIT)); + app.alert("Array equality test (===): " + + (RE_PHONE_COMMIT === RE_PHONE_COMMIT)); +} try { doTest("border", ["s", "b", "d", "i", "u", "nonesuch"]); @@ -112,6 +122,7 @@ try { "RE_SSN_COMMIT" ]); + doEqualityTests(); } catch (e) { app.alert("ERROR: " + e.toString()); } diff --git a/testing/resources/javascript/consts_expected.txt b/testing/resources/javascript/consts_expected.txt index 4476c62b24..a2d29a9973 100644 --- a/testing/resources/javascript/consts_expected.txt +++ b/testing/resources/javascript/consts_expected.txt @@ -106,3 +106,7 @@ Alert: RE_SSN_ENTRY is \d{0,3}(\.|[- ])?\d{0,2}(\.|[- ])?\d{0,4} Alert: RE_SSN_COMMIT is \d{3}(\.|[- ])?\d{2}(\.|[- ])?\d{4} +Alert: String equality test (==): true +Alert: String equality test (===): true +Alert: Array equality test (==): true +Alert: Array equality test (===): true -- cgit v1.2.3