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

Side by Side Diff: headless/test/bindings_test.js

Issue 2902583002: Add some closureised JS bindings for DevTools for use by headless embedder (Closed)
Patch Set: Don't run the test on windows because js_binary doesn't work Created 3 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
OLDNEW
(Empty)
1 // Copyright 2017 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 goog.require('goog.DevTools.DOM');
6 goog.require('goog.DevTools.Runtime');
7 goog.require('goog.DevTools.TestHarness');
8 goog.provide('goog.DevTools.BindingsTest');
9
10 goog.DevTools.TestHarness.AddTest("Simple Test", function(test) {
11 var Runtime = new goog.DevTools.Runtime(test.connection_);
12 Runtime.Evaluate({'expression': '1+1'}).then(function(message) {
13 test.AssertEq(2, message.result.value, "(message.result.value)");
14 test.Finish();
15 });
16 });
17
18 goog.DevTools.TestHarness.AddTest("Event Test", function(test) {
19 var DOM = new goog.DevTools.DOM(test.connection_);
20 var Runtime = new goog.DevTools.Runtime(test.connection_);
21 var bodyNode = {};
22 DOM.Enable();
Sami 2017/05/24 09:16:21 We should wait for this to finish I think.
alex clarke (OOO till 29th) 2017/05/24 11:38:16 Done.
23 DOM.OnChildNodeCountUpdated(function(params) {
24 test.AssertEq(1, params.childNodeCount, "(params.childNodeCount)");
25 test.AssertEq(bodyNode.nodeId, params.nodeId, "(params.nodeId)");
26 test.Finish();
27 });
28 DOM.GetDocument({}).then(function(result) {
29 bodyNode = result.root.children[0].children[1];
30 test.AssertEq("BODY", bodyNode.nodeName, "(bodyNode.nodeName)");
31 var div = document.createElement('div');
32 document.body.appendChild(div);
33 });
34 });
35
36 goog.DevTools.TestHarness.RunTests();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698