diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2016-12-16 07:01:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-16 07:01:58 +0300 |
commit | af368cfc02bae5026429b0418d83de2b0890ef44 (patch) | |
tree | 3f835f1b494253f25b24db668e828bedd0d0017a /tests | |
parent | d5377a5149e58457a5d064bece11d7d7aaef4b7a (diff) | |
parent | a8240ff4f99aec2d4419bee1e86788b75fc6437b (diff) |
Merge pull request #11026 from piwik/3.x-dev3.0.0-rc4
Piwik 3.0.0-rc4 release
Diffstat (limited to 'tests')
4 files changed, 72 insertions, 66 deletions
diff --git a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png index 2269c711af..e11b4e6329 100644 --- a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png +++ b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:85f5af5eaf5ba40da49eeba5efef0263eb25dcedb2eca3426fa988f8e1c9a786 -size 175434 +oid sha256:e73789714f952abb0d5e1673ff6340eeb0563b07284b7646436802b3109d62a9 +size 178794 diff --git a/tests/UI/expected-screenshots/Installation_js_tracking.png b/tests/UI/expected-screenshots/Installation_js_tracking.png index 025ec4f078..f9141294b2 100644 --- a/tests/UI/expected-screenshots/Installation_js_tracking.png +++ b/tests/UI/expected-screenshots/Installation_js_tracking.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:05078353764c65c355af7f3b96a2948be8a89f75d1ffe508209354b50b095b7d -size 188228 +oid sha256:e4e8e866011ff143a95da23a4366e1306b20eb3670b29f59db2880b2798452ea +size 192744 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_tracking_code.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_tracking_code.png index 55437c0de4..c24b54671b 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_tracking_code.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_tracking_code.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e91ed391775cdb660f8f699b6674c820e2e6e478a6f468ebccc99d05425316ae -size 297741 +oid sha256:9cb4ac6babbc2143080ab724617639d8fbfa4d10b789072be0be65f1170a5a34 +size 301267 diff --git a/tests/javascript/index.php b/tests/javascript/index.php index 3cc05b286e..c1686d26c0 100644 --- a/tests/javascript/index.php +++ b/tests/javascript/index.php @@ -508,95 +508,95 @@ function PiwikTest() { var tracker = Piwik.getTracker(), dummy; - equal( typeof JSON2.stringify, 'function', 'JSON.stringify function' ); - equal( typeof JSON2.stringify(dummy), 'undefined', 'undefined' ); + equal( typeof JSON_PIWIK.stringify, 'function', 'JSON.stringify function' ); + equal( typeof JSON_PIWIK.stringify(dummy), 'undefined', 'undefined' ); - equal( JSON2.stringify(null), 'null', 'null' ); - equal( JSON2.stringify(true), 'true', 'true' ); - equal( JSON2.stringify(false), 'false', 'false' ); - ok( JSON2.stringify(0) === '0', 'Number 0' ); - ok( JSON2.stringify(1) === '1', 'Number 1' ); - ok( JSON2.stringify(-1) === '-1', 'Number -1' ); - ok( JSON2.stringify(42) === '42', 'Number 42' ); + equal( JSON_PIWIK.stringify(null), 'null', 'null' ); + equal( JSON_PIWIK.stringify(true), 'true', 'true' ); + equal( JSON_PIWIK.stringify(false), 'false', 'false' ); + ok( JSON_PIWIK.stringify(0) === '0', 'Number 0' ); + ok( JSON_PIWIK.stringify(1) === '1', 'Number 1' ); + ok( JSON_PIWIK.stringify(-1) === '-1', 'Number -1' ); + ok( JSON_PIWIK.stringify(42) === '42', 'Number 42' ); - ok( JSON2.stringify(1.0) === '1.0' - || JSON2.stringify(1.0) === '1', 'float 1.0' ); + ok( JSON_PIWIK.stringify(1.0) === '1.0' + || JSON_PIWIK.stringify(1.0) === '1', 'float 1.0' ); - equal( JSON2.stringify(1.1), '1.1', 'float 1.1' ); - equal( JSON2.stringify(""), '""', 'empty string' ); - equal( JSON2.stringify('"'), '"' + '\\' + '"' + '"', 'string "' ); - equal( JSON2.stringify('\\'), '"' + '\\\\' + '"', 'string \\' ); + equal( JSON_PIWIK.stringify(1.1), '1.1', 'float 1.1' ); + equal( JSON_PIWIK.stringify(""), '""', 'empty string' ); + equal( JSON_PIWIK.stringify('"'), '"' + '\\' + '"' + '"', 'string "' ); + equal( JSON_PIWIK.stringify('\\'), '"' + '\\\\' + '"', 'string \\' ); - equal( JSON2.stringify("1"), '"1"', 'string "1"' ); - equal( JSON2.stringify("ABC"), '"ABC"', 'string ABC' ); - equal( JSON2.stringify("\x40\x41\x42\x43"), '"@ABC"', '\\x hex string @ABC' ); + equal( JSON_PIWIK.stringify("1"), '"1"', 'string "1"' ); + equal( JSON_PIWIK.stringify("ABC"), '"ABC"', 'string ABC' ); + equal( JSON_PIWIK.stringify("\x40\x41\x42\x43"), '"@ABC"', '\\x hex string @ABC' ); - ok( JSON2.stringify("\u60a8\u597d") == '"您好"' - || JSON2.stringify("\u60a8\u597d") == '"\\u60a8\\u597d"', '\\u Unicode string 您好' ); + ok( JSON_PIWIK.stringify("\u60a8\u597d") == '"您好"' + || JSON_PIWIK.stringify("\u60a8\u597d") == '"\\u60a8\\u597d"', '\\u Unicode string 您好' ); - ok( JSON2.stringify("ßéàêö您好") == '"ßéàêö您好"' - || JSON2.stringify("ßéàêö您好") == '"\\u00df\\u00e9\\u00e0\\u00ea\\u00f6\\u60a8\\u597d"', 'string non-ASCII text' ); + ok( JSON_PIWIK.stringify("ßéàêö您好") == '"ßéàêö您好"' + || JSON_PIWIK.stringify("ßéàêö您好") == '"\\u00df\\u00e9\\u00e0\\u00ea\\u00f6\\u60a8\\u597d"', 'string non-ASCII text' ); - equal( JSON2.stringify("20060228T08:00:00"), '"20060228T08:00:00"', 'string "20060228T08:00:00"' ); + equal( JSON_PIWIK.stringify("20060228T08:00:00"), '"20060228T08:00:00"', 'string "20060228T08:00:00"' ); var d = new Date(); d.setTime(1240013340000); - ok( JSON2.stringify(d) === '"2009-04-18T00:09:00Z"' - || JSON2.stringify(d) === '"2009-04-18T00:09:00.000Z"', 'Date'); + ok( JSON_PIWIK.stringify(d) === '"2009-04-18T00:09:00Z"' + || JSON_PIWIK.stringify(d) === '"2009-04-18T00:09:00.000Z"', 'Date'); - equal( JSON2.stringify([1, 2, 3]), '[1,2,3]', 'Array of numbers' ); - equal( JSON2.stringify({'key' : 'value'}), '{"key":"value"}', 'Object (members)' ); - equal( JSON2.stringify( + equal( JSON_PIWIK.stringify([1, 2, 3]), '[1,2,3]', 'Array of numbers' ); + equal( JSON_PIWIK.stringify({'key' : 'value'}), '{"key":"value"}', 'Object (members)' ); + equal( JSON_PIWIK.stringify( [ {'domains' : ['example.com', 'example.ca']}, {'names' : ['Sean', 'Cathy'] } ] ), '[{"domains":["example.com","example.ca"]},{"names":["Sean","Cathy"]}]', 'Nested members' ); equal( typeof eval('('+dummy+')'), 'undefined', 'eval undefined' ); - equal( typeof JSON2.parse, 'function', 'JSON.parse function' ); + equal( typeof JSON_PIWIK.parse, 'function', 'JSON.parse function' ); // these throw a SyntaxError -// equal( typeof JSON2.parse('undefined'), 'undefined', 'undefined' ); -// equal( typeof JSON2.parse(dummy), 'undefined', 'undefined' ); -// equal( JSON2.parse('undefined'), dummy, 'undefined' ); -// equal( JSON2.parse('undefined'), undefined, 'undefined' ); +// equal( typeof JSON_PIWIK.parse('undefined'), 'undefined', 'undefined' ); +// equal( typeof JSON_PIWIK.parse(dummy), 'undefined', 'undefined' ); +// equal( JSON_PIWIK.parse('undefined'), dummy, 'undefined' ); +// equal( JSON_PIWIK.parse('undefined'), undefined, 'undefined' ); - strictEqual( JSON2.parse('null'), null, 'null' ); - strictEqual( JSON2.parse('true'), true, 'true' ); - strictEqual( JSON2.parse('false'), false, 'false' ); + strictEqual( JSON_PIWIK.parse('null'), null, 'null' ); + strictEqual( JSON_PIWIK.parse('true'), true, 'true' ); + strictEqual( JSON_PIWIK.parse('false'), false, 'false' ); - equal( JSON2.parse('0'), 0, 'Number 0' ); - equal( JSON2.parse('1'), 1, 'Number 1' ); - equal( JSON2.parse('-1'), -1, 'Number -1' ); - equal( JSON2.parse('42'), 42, 'Number 42' ); + equal( JSON_PIWIK.parse('0'), 0, 'Number 0' ); + equal( JSON_PIWIK.parse('1'), 1, 'Number 1' ); + equal( JSON_PIWIK.parse('-1'), -1, 'Number -1' ); + equal( JSON_PIWIK.parse('42'), 42, 'Number 42' ); - ok( JSON2.parse('1.0') === 1.0 - || JSON2.parse('1.0') === 1, 'float 1.0' ); + ok( JSON_PIWIK.parse('1.0') === 1.0 + || JSON_PIWIK.parse('1.0') === 1, 'float 1.0' ); - equal( JSON2.parse('1.1'), 1.1, 'float 1.1' ); - equal( JSON2.parse('""'), "", 'empty string' ); - equal( JSON2.parse('"' + '\\' + '"' + '"'), '"', 'string "' ); - equal( JSON2.parse('"\\\\"'), '\\', 'string \\' ); + equal( JSON_PIWIK.parse('1.1'), 1.1, 'float 1.1' ); + equal( JSON_PIWIK.parse('""'), "", 'empty string' ); + equal( JSON_PIWIK.parse('"' + '\\' + '"' + '"'), '"', 'string "' ); + equal( JSON_PIWIK.parse('"\\\\"'), '\\', 'string \\' ); - equal( JSON2.parse('"1"'), "1", 'string "1"' ); - equal( JSON2.parse('"ABC"'), "ABC", 'string ABC' ); - equal( JSON2.parse('"@ABC"'), "\x40\x41\x42\x43", 'Hex string @ABC' ); + equal( JSON_PIWIK.parse('"1"'), "1", 'string "1"' ); + equal( JSON_PIWIK.parse('"ABC"'), "ABC", 'string ABC' ); + equal( JSON_PIWIK.parse('"@ABC"'), "\x40\x41\x42\x43", 'Hex string @ABC' ); - ok( JSON2.parse('"您好"') == "\u60a8\u597d" - && JSON2.parse('"\\u60a8\\u597d"') == "您好", 'Unicode string 您好' ); + ok( JSON_PIWIK.parse('"您好"') == "\u60a8\u597d" + && JSON_PIWIK.parse('"\\u60a8\\u597d"') == "您好", 'Unicode string 您好' ); - ok( JSON2.parse('"ßéàêö您好"') == "ßéàêö您好" - && JSON2.parse('"\\u00df\\u00e9\\u00e0\\u00ea\\u00f6\\u60a8\\u597d"') == "ßéàêö您好", 'string non-ASCII text' ); + ok( JSON_PIWIK.parse('"ßéàêö您好"') == "ßéàêö您好" + && JSON_PIWIK.parse('"\\u00df\\u00e9\\u00e0\\u00ea\\u00f6\\u60a8\\u597d"') == "ßéàêö您好", 'string non-ASCII text' ); - equal( JSON2.parse('"20060228T08:00:00"'), "20060228T08:00:00", 'string "20060228T08:00:00"' ); + equal( JSON_PIWIK.parse('"20060228T08:00:00"'), "20060228T08:00:00", 'string "20060228T08:00:00"' ); // these aren't converted back to Date objects - equal( JSON2.parse('"2009-04-18T00:09:00Z"'), "2009-04-18T00:09:00Z", 'string "2009-04-18T00:09:00Z"' ); - equal( JSON2.parse('"2009-04-18T00:09:00.000Z"'), "2009-04-18T00:09:00.000Z", 'string "2009-04-18T00:09:00.000Z"' ); + equal( JSON_PIWIK.parse('"2009-04-18T00:09:00Z"'), "2009-04-18T00:09:00Z", 'string "2009-04-18T00:09:00Z"' ); + equal( JSON_PIWIK.parse('"2009-04-18T00:09:00.000Z"'), "2009-04-18T00:09:00.000Z", 'string "2009-04-18T00:09:00.000Z"' ); - deepEqual( JSON2.parse('[1,2,3]'), [1, 2, 3], 'Array of numbers' ); - deepEqual( JSON2.parse('{"key":"value"}'), {'key' : 'value'}, 'Object (members)' ); - deepEqual( JSON2.parse('[{"domains":["example.com","example.ca"]},{"names":["Sean","Cathy"]}]'), + deepEqual( JSON_PIWIK.parse('[1,2,3]'), [1, 2, 3], 'Array of numbers' ); + deepEqual( JSON_PIWIK.parse('{"key":"value"}'), {'key' : 'value'}, 'Object (members)' ); + deepEqual( JSON_PIWIK.parse('[{"domains":["example.com","example.ca"]},{"names":["Sean","Cathy"]}]'), [ {'domains' : ['example.com', 'example.ca']}, {'names' : ['Sean', 'Cathy'] } ], 'Nested members' ); }); @@ -610,7 +610,7 @@ function PiwikTest() { }); test("Piwik plugin methods", function() { - expect(26); + expect(31); // TESTS FOR retryMissedPluginCalls @@ -720,6 +720,12 @@ function PiwikTest() { triggerEvent(_e('click7'), 'myCustomEvent'); strictEqual(true, customEvent, "DOM.addEventListener works"); + + strictEqual('object', typeof Piwik.JSON, "Piwik.JSON object is defined"); + strictEqual('function', typeof Piwik.JSON.stringify, "JSON.stringify method is defined"); + strictEqual('function', typeof Piwik.JSON.parse, "JSON.parse method is defined"); + strictEqual('[]', Piwik.JSON.stringify([])); + propEqual([], Piwik.JSON.parse('[]')); }); test("Query", function() { |