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

Side by Side Diff: Source/core/testing/Internals.js

Issue 360703003: Implement Blink-in-JS for DOM methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/testing/Internals.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 "use strict";
6
7 installClass("Internals", function(global) {
8 var InternalsPrototype = Object.create(Element.prototype);
9
10 InternalsPrototype.doNothing = function() {
11 }
12
13 InternalsPrototype.return123 = function() {
14 return 123;
15 }
16
17 InternalsPrototype.echoInteger = function(value) {
18 return value;
19 }
20
21 InternalsPrototype.echoString = function(value) {
22 return value;
23 }
24
25 InternalsPrototype.echoNode = function(value) {
26 return value;
27 }
28
29 InternalsPrototype.addInteger = function(value1, value2) {
30 return value1 + value2;
31 }
32
33 InternalsPrototype.addString = function(value1, value2) {
34 return value1 + value2;
35 }
36
37 InternalsPrototype.setIntegerToDocument = function(document, value) {
38 document.integer = value;
39 }
40
41 InternalsPrototype.getIntegerFromDocument = function(document) {
42 return document.integer;
43 }
44
45 InternalsPrototype.setIntegerToPrototype = function(value) {
46 this.integer = value;
47 }
48
49 InternalsPrototype.getIntegerFromPrototype = function() {
50 return this.integer;
51 }
52
53 InternalsPrototype.createElement = function(document) {
54 return document.createElement("div");
55 }
56
57 InternalsPrototype.appendChild = function(node1, node2) {
58 node1.appendChild(node2);
59 }
60
61 InternalsPrototype.firstChild = function(node) {
62 return node.firstChild;
63 }
64
65 InternalsPrototype.nextSibling = function(node) {
66 return node.nextSibling;
67 }
68
69 InternalsPrototype.innerHTML = function(node) {
70 return node.innerHTML;
71 }
72
73 InternalsPrototype.setInnerHTML = function(node, string) {
74 node.innerHTML = string;
75 }
76
77 InternalsPrototype.addClickListener = function(node) {
78 node.addEventListener("click", function () {
79 node.innerHTML = "clicked";
80 });
81 }
82
83 InternalsPrototype.clickNode = function(document, node) {
84 var event = new MouseEvent("click", { bubbles: true, cancelable: true, v iew: global });
85 node.dispatchEvent(event);
86 }
87
88 return InternalsPrototype;
89 });
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698