Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: third_party/WebKit/Tools/qunit/test/logs.js

Issue 1475853002: Remove qunit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // TODO disable reordering for this suite!
2
3
4 var begin = 0,
5 moduleStart = 0,
6 moduleDone = 0,
7 testStart = 0,
8 testDone = 0,
9 log = 0,
10 moduleContext,
11 moduleDoneContext,
12 testContext,
13 testDoneContext,
14 logContext;
15
16 QUnit.begin = function() {
17 begin++;
18 };
19 QUnit.done = function() {
20 };
21 QUnit.moduleStart = function(context) {
22 moduleStart++;
23 moduleContext = context;
24 };
25 QUnit.moduleDone = function(context) {
26 moduleDone++;
27 moduleDoneContext = context;
28 };
29 QUnit.testStart = function(context) {
30 testStart++;
31 testContext = context;
32 };
33 QUnit.testDone = function(context) {
34 testDone++;
35 testDoneContext = context;
36 };
37 QUnit.log = function(context) {
38 log++;
39 logContext = context;
40 };
41
42 var logs = ["begin", "testStart", "testDone", "log", "moduleStart", "moduleDone" , "done"];
43 for (var i = 0; i < logs.length; i++) {
44 (function() {
45 var log = logs[i],
46 logger = QUnit[log];
47 QUnit[log] = function() {
48 console.log(log, arguments);
49 logger.apply(this, arguments);
50 };
51 })();
52 }
53
54 module("logs1");
55
56 test("test1", 13, function() {
57 equal(begin, 1);
58 equal(moduleStart, 1);
59 equal(testStart, 1);
60 equal(testDone, 0);
61 equal(moduleDone, 0);
62
63 deepEqual(logContext, {
64 result: true,
65 message: undefined,
66 actual: 0,
67 expected: 0
68 });
69 equal("foo", "foo", "msg");
70 deepEqual(logContext, {
71 result: true,
72 message: "msg",
73 actual: "foo",
74 expected: "foo"
75 });
76 strictEqual(testDoneContext, undefined);
77 deepEqual(testContext, {
78 name: "test1"
79 });
80 strictEqual(moduleDoneContext, undefined);
81 deepEqual(moduleContext, {
82 name: "logs1"
83 });
84
85 equal(log, 12);
86 });
87 test("test2", 10, function() {
88 equal(begin, 1);
89 equal(moduleStart, 1);
90 equal(testStart, 2);
91 equal(testDone, 1);
92 equal(moduleDone, 0);
93
94 deepEqual(testDoneContext, {
95 name: "test1",
96 failed: 0,
97 passed: 13,
98 total: 13
99 });
100 deepEqual(testContext, {
101 name: "test2"
102 });
103 strictEqual(moduleDoneContext, undefined);
104 deepEqual(moduleContext, {
105 name: "logs1"
106 });
107
108 equal(log, 22);
109 });
110
111 module("logs2");
112
113 test("test1", 9, function() {
114 equal(begin, 1);
115 equal(moduleStart, 2);
116 equal(testStart, 3);
117 equal(testDone, 2);
118 equal(moduleDone, 1);
119
120 deepEqual(testContext, {
121 name: "test1"
122 });
123 deepEqual(moduleDoneContext, {
124 name: "logs1",
125 failed: 0,
126 passed: 23,
127 total: 23
128 });
129 deepEqual(moduleContext, {
130 name: "logs2"
131 });
132
133 equal(log, 31);
134 });
135 test("test2", 8, function() {
136 equal(begin, 1);
137 equal(moduleStart, 2);
138 equal(testStart, 4);
139 equal(testDone, 3);
140 equal(moduleDone, 1);
141
142 deepEqual(testContext, {
143 name: "test2"
144 });
145 deepEqual(moduleContext, {
146 name: "logs2"
147 });
148
149 equal(log, 39);
150 });
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/qunit/test/logs.html ('k') | third_party/WebKit/Tools/qunit/test/same.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698