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

Unified Diff: test/webkit/fast/js/kde/Prototype.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
« no previous file with comments | « test/webkit/fast/js/kde/Object-expected.txt ('k') | test/webkit/fast/js/kde/Prototype-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/webkit/fast/js/kde/Prototype.js
diff --git a/test/webkit/regexp-find-first-asserted.js b/test/webkit/fast/js/kde/Prototype.js
similarity index 62%
copy from test/webkit/regexp-find-first-asserted.js
copy to test/webkit/fast/js/kde/Prototype.js
index ce8628fd35dd34b181d0376933fe82ac747f6e5d..a2971fde189cb31d099c08b956607cba5ad3ecd4 100644
--- a/test/webkit/regexp-find-first-asserted.js
+++ b/test/webkit/fast/js/kde/Prototype.js
@@ -21,11 +21,38 @@
// (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(
-'Tests some regular expressions that were doing the wrong thing with the "find first asserted" optimization.'
-);
+description("KDE JS Test");
+///////////////////////////////////////////////////////
-shouldBe('/.*<body>(.*)<\\/body>.*/.exec("foo<body>bar</body>baz").toString()', '"foo<body>bar</body>baz,bar"');
-shouldBe('/\\s*<!--([\s\S]*)\\/\\/\\s*-->\\s*/.exec("<!--// -->").toString()', '"<!--// -->,"');
+function Square(x)
+{
+ this.x = x;
+}
-debug('');
+new Square(0); // create prototype
+
+function Square_area() { return this.x * this.x; }
+Square.prototype.area = Square_area;
+var s = new Square(3);
+shouldBe("s.area()", "9");
+
+///////////////////////////////////////////////////////
+
+function Item(name){
+ this.name = name;
+}
+
+function Book(name, author){
+ this.base = Item; // set Item constructor as method of Book object
+ this.base(name); // set the value of name property
+ this.author = author;
+}
+Book.prototype = new Item;
+var b = new Book("a book", "Fred"); // create object instance
+//edebug(e"b.name"));
+shouldBe("b.name", "'a book'");
+shouldBe("b.author", "'Fred'"); // outpus "Fred"
+
+///////////////////////////////////////////////////////
+
+shouldBe("delete Boolean.prototype", "false");
« no previous file with comments | « test/webkit/fast/js/kde/Object-expected.txt ('k') | test/webkit/fast/js/kde/Prototype-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698