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

Unified Diff: test/webkit/fast/js/function-decompilation-operators.js

Issue 21070002: Migrate more tests from blink repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: test/webkit/fast/js/function-decompilation-operators.js
diff --git a/test/webkit/ignored-result-ref-crash.js b/test/webkit/fast/js/function-decompilation-operators.js
similarity index 52%
copy from test/webkit/ignored-result-ref-crash.js
copy to test/webkit/fast/js/function-decompilation-operators.js
index d2deea2a8d5c6a72b4f17b9fe7f8aa1e9c3de2ee..759767f88e4e30fe7670fa62c8cfb01e00b315c5 100644
--- a/test/webkit/ignored-result-ref-crash.js
+++ b/test/webkit/fast/js/function-decompilation-operators.js
@@ -21,66 +21,63 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-description(
-"This tests that bytecode code generation doesn't crash when it encounters odd cases of an ignored result."
-);
+description("This test checks toString() round-trip decompilation for binary and unary operators.");
-function emptyStatementDoWhileTest()
-{
- do
- ;
- while (false) { }
- return true;
-}
+ var tests = [
+ "x + + y",
+ "x + - y",
+ "x - + y",
+ "x - - y",
+ "x * + y",
+ "x * - y",
+ "x / + y",
+ "x / - y",
+ "x % + y",
+ "x % - y",
+ "x++ + y",
+ "x++ - y",
+ "x++ * y",
+ "x++ / y",
+ "x-- + y",
+ "x-- - y",
+ "x-- * y",
+ "x-- / y",
+ "x + ++y",
+ "x - ++y",
+ "x * ++y",
+ "x / ++y",
+ "x + --y",
+ "x - --y",
+ "x * --y",
+ "x / --y",
+ "x++ + ++y",
+ "x++ - ++y",
+ "x++ * ++y",
+ "x++ / ++y",
+ "x-- + ++y",
+ "x-- - ++y",
+ "x-- * ++y",
+ "x-- / ++y",
+ "x++ + --y",
+ "x++ - --y",
+ "x++ * --y",
+ "x++ / --y",
+ "x-- + --y",
+ "x-- - --y",
+ "x-- * --y",
+ "x-- / --y",
+ "+ + x",
+ "+ - x",
+ "- + x",
+ "- - x",
+ "1",
+ "-1",
+ "- -1",
+ "- - 0",
+ "- - NaN"
+ ];
-shouldBeTrue("emptyStatementDoWhileTest()");
-
-function debuggerDoWhileTest()
-{
- do
- debugger;
- while (false) { }
- return true;
-}
-
-shouldBeTrue("debuggerDoWhileTest()");
-
-function continueDoWhileTest()
-{
- var i = 0;
- do
- i++;
- while (i < 10) {
- do
- continue;
- while (false) { }
- }
- return true;
-}
-
-shouldBeTrue("continueDoWhileTest()");
-
-function breakDoWhileTest()
-{
- var i = 0;
- do
- i++;
- while (i < 10) {
- do
- continue;
- while (false) { }
- }
- return true;
-}
-
-shouldBeTrue("breakDoWhileTest()");
-
-function tryDoWhileTest()
-{
- do
- try { } catch (o) { }
- while (false) { }
- return true;
-}
-
-shouldBeTrue("tryDoWhileTest()");
+ for (test in tests) {
+ var decompiledFunction = eval("(function () { " + tests[test] + ";})").toString().replace(/\n/g, "");
+ shouldBe("decompiledFunction", "'function () { " + tests[test] + ";}'");
+ }

Powered by Google App Engine
This is Rietveld 408576698