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

Side by Side Diff: Source/bindings/v8/PrivateScriptTest.js

Issue 345893002: Implement an infrastructure of Blink-in-JS Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/bindings/v8/PrivateScriptTest.idl ('k') | Source/bindings/v8/ScriptController.cpp » ('j') | 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("PrivateScriptTest", function() {
8 function doNothing() {
9 }
10 function return123() {
11 return 123;
12 }
13 function echoInteger(value) {
14 return value;
15 }
16 function echoString(value) {
17 return value;
18 }
19 function echoNode(value) {
20 return value;
21 }
22 function addInteger(value1, value2) {
23 return value1 + value2;
24 }
25 function addString(value1, value2) {
26 return value1 + value2;
27 }
28 function setIntegerToDocument(document, value) {
29 document.integer = value;
30 }
31 function getIntegerFromDocument(document) {
32 return document.integer;
33 }
34 function createElement(document) {
35 return document.createElement("div");
36 }
37 function appendChild(node1, node2) {
38 node1.appendChild(node2);
39 }
40 function firstChild(node) {
41 return node.firstChild;
42 }
43 function nextSibling(node) {
44 return node.nextSibling;
45 }
46 function innerHTML(node) {
47 return node.innerHTML;
48 }
49 function setInnerHTML(node, string) {
50 node.innerHTML = string;
51 }
52 function addClickListener(node) {
53 node.addEventListener("click", function () {
54 node.innerHTML = "clicked";
55 });
56 }
57 function clickNode(document, node) {
58 var event = new MouseEvent("click", { bubbles: true, cancelable: true, v iew: window });
59 node.dispatchEvent(event);
60 }
61
62 return { doNothing : doNothing,
63 return123 : return123,
64 echoInteger : echoInteger,
65 echoString : echoString,
66 echoNode : echoNode,
67 addInteger : addInteger,
68 addString : addString,
69 setIntegerToDocument : setIntegerToDocument,
70 getIntegerFromDocument : getIntegerFromDocument,
71 createElement : createElement,
72 appendChild : appendChild,
73 firstChild : firstChild,
74 nextSibling : nextSibling,
75 innerHTML : innerHTML,
76 setInnerHTML : setInnerHTML,
77 addClickListener : addClickListener,
78 clickNode : clickNode,
79 };
80 });
OLDNEW
« no previous file with comments | « Source/bindings/v8/PrivateScriptTest.idl ('k') | Source/bindings/v8/ScriptController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698