Commit 0c32d8c5 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix debug-promises tests.

Using assertEquals on two Promises always passes. Use assertSame instead.

R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/455683002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22995 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d9d6a609
......@@ -36,7 +36,7 @@ function listener(event, exec_state, event_data, data) {
expected_events--;
assertTrue(expected_events >= 0);
assertEquals("reject", event_data.exception().message);
assertEquals(q, event_data.promise());
assertSame(q, event_data.promise());
assertFalse(event_data.uncaught());
}
} catch (e) {
......
......@@ -31,7 +31,7 @@ function listener(event, exec_state, event_data, data) {
assertTrue(expected_events >= 0);
assertEquals("uncaught reject", event_data.exception().message);
assertTrue(event_data.promise() instanceof Promise);
assertEquals(q, event_data.promise());
assertSame(q, event_data.promise());
assertTrue(event_data.uncaught());
// All of the frames on the stack are from native Javascript.
assertEquals(0, exec_state.frameCount());
......
......@@ -38,7 +38,7 @@ function listener(event, exec_state, event_data, data) {
assertTrue(expected_events >= 0);
assertEquals("uncaught reject p", event_data.exception().message);
assertTrue(event_data.promise() instanceof Promise);
assertEquals(p, event_data.promise());
assertSame(p, event_data.promise());
assertTrue(event_data.uncaught());
// Assert that the debug event is triggered at the throw site.
assertTrue(exec_state.frame(0).sourceLineText().indexOf("// event") > 0);
......
......@@ -31,7 +31,7 @@ function listener(event, exec_state, event_data, data) {
assertTrue(expected_events >= 0);
assertEquals("uncaught reject", event_data.exception().message);
assertTrue(event_data.promise() instanceof Promise);
assertEquals(q, event_data.promise());
assertSame(q, event_data.promise());
assertTrue(event_data.uncaught());
// All of the frames on the stack are from native Javascript.
assertEquals(0, exec_state.frameCount());
......
......@@ -42,7 +42,6 @@ function listener(event, exec_state, event_data, data) {
assertEquals("number is not a function", event_data.exception().message);
// All of the frames on the stack are from native Javascript.
assertEquals(0, exec_state.frameCount());
assertEquals(q, event_data.promise());
}
} catch (e) {
%AbortJS(e + "\n" + e.stack);
......
......@@ -42,7 +42,6 @@ function listener(event, exec_state, event_data, data) {
assertEquals("caught", event_data.exception().message);
// All of the frames on the stack are from native Javascript.
assertEquals(0, exec_state.frameCount());
assertEquals(q, event_data.promise());
}
} catch (e) {
%AbortJS(e + "\n" + e.stack);
......
......@@ -35,7 +35,7 @@ function listener(event, exec_state, event_data, data) {
expected_events--;
assertTrue(expected_events >= 0);
assertEquals("caught", event_data.exception().message);
assertEquals(q, event_data.promise());
assertSame(q, event_data.promise());
assertFalse(event_data.uncaught());
}
} catch (e) {
......
......@@ -32,7 +32,7 @@ function listener(event, exec_state, event_data, data) {
assertTrue(expected_events >= 0);
assertEquals("uncaught", event_data.exception().message);
assertTrue(event_data.promise() instanceof Promise);
assertEquals(q, event_data.promise());
assertSame(q, event_data.promise());
assertTrue(event_data.uncaught());
// Assert that the debug event is triggered at the throw site.
assertTrue(exec_state.frame(0).sourceLineText().indexOf("// event") > 0);
......
......@@ -32,7 +32,7 @@ function listener(event, exec_state, event_data, data) {
assertTrue(expected_events >= 0);
assertEquals("uncaught", event_data.exception().message);
assertTrue(event_data.promise() instanceof Promise);
assertEquals(q, event_data.promise());
assertSame(q, event_data.promise());
assertTrue(event_data.uncaught());
// Assert that the debug event is triggered at the throw site.
assertTrue(exec_state.frame(0).sourceLineText().indexOf("// event") > 0);
......
......@@ -53,7 +53,7 @@ function listener(event, exec_state, event_data, data) {
} else {
assertUnreachable();
}
assertEquals(q, event_data.promise());
assertSame(q, event_data.promise());
assertTrue(exec_state.frame(0).sourceLineText().indexOf('// event') > 0);
}
} catch (e) {
......
......@@ -53,7 +53,7 @@ function listener(event, exec_state, event_data, data) {
} else {
assertUnreachable();
}
assertEquals(q, event_data.promise());
assertSame(q, event_data.promise());
}
} catch (e) {
%AbortJS(e + "\n" + e.stack);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment