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

Unified Diff: tests/html/js_interop_constructor_name_test_js.js

Issue 2379173002: Add native_testing library to mock @Native classes (Closed)
Patch Set: xxx Created 4 years, 1 month 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 | « tests/html/js_interop_constructor_name_test.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/js_interop_constructor_name_test_js.js
diff --git a/tests/html/js_interop_constructor_name_test_js.js b/tests/html/js_interop_constructor_name_test_js.js
new file mode 100644
index 0000000000000000000000000000000000000000..828cbc94779de9f66179bfde60dbd1891d8890e4
--- /dev/null
+++ b/tests/html/js_interop_constructor_name_test_js.js
@@ -0,0 +1,20 @@
+(function() {
+
+ // A constructor function with the same name as a HTML element.
+ function HTMLDivElement(a) {
+ this.a = a;
+ }
+
+ HTMLDivElement.prototype.bar = function() {
+ return this.a;
+ }
+
+ HTMLDivElement.prototype.toString = function() {
+ return "HTMLDivElement(" + this.a + ")";
+ }
+
+ self.makeDiv = function(text) {
+ return new HTMLDivElement(text);
+ };
+
+})();
« no previous file with comments | « tests/html/js_interop_constructor_name_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698