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

Side by Side Diff: sky/tests/resources/event-sender.dart

Issue 959993002: Dart: Removes name conflicts from generated bindings. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import "/sky/framework/embedder.dart"; 5 import "/sky/framework/embedder.dart";
6 import "dart:async"; 6 import "dart:async";
7 import "dart:sky"; 7 import "dart:sky";
8 import "dart:sky.internals" as internals; 8 import "dart:sky.internals" as internals;
9 import "package:mojo/services/input_events/public/interfaces/input_event_constan ts.mojom.dart" as constants; 9 import "package:mojo/services/input_events/public/interfaces/input_event_constan ts.mojom.dart" as constants;
10 import "package:mojo/services/input_events/public/interfaces/input_events.mojom. dart" as events; 10 import "package:mojo/services/input_events/public/interfaces/input_events.mojom. dart" as events;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 void handleKeyPress_(Event event) { 56 void handleKeyPress_(Event event) {
57 --_keyPressesRemaining; 57 --_keyPressesRemaining;
58 _checkComplete(); 58 _checkComplete();
59 } 59 }
60 60
61 harness.TestHarnessProxy _init() { 61 harness.TestHarnessProxy _init() {
62 document.addEventListener('keypress', handleKeyPress_); 62 document.addEventListener('keypress', handleKeyPress_);
63 63
64 var harnessProxy = new harness.TestHarnessProxy.unbound(); 64 var harnessProxy = new harness.TestHarnessProxy.unbound();
65 embedder.connectToService("mojo:sky_tester", harnessProxy); 65 embedder.connectToService("mojo:sky_tester",
66 harness.TestHarnessRequest(harnessProxy));
66 return harnessProxy; 67 return harnessProxy;
67 } 68 }
68 69
69 final harness.TestHarnessProxy _harness = _init(); 70 final harness.TestHarnessProxy _harness = _init();
70 71
71 // |0| should be EventFlags_NONE once its a compile-time constant. 72 // |0| should be EventFlags_NONE once its a compile-time constant.
72 void keyDown(int keyCode, [int eventFlags = 0]) { 73 void keyDown(int keyCode, [int eventFlags = 0]) {
73 if (!_chars.contains(keyCode)) { 74 if (!_chars.contains(keyCode)) {
74 _harness.dispatchInputEvent( 75 _harness.dispatchInputEvent(
75 new events.Event() 76 new events.Event()
(...skipping 24 matching lines...) Expand all
100 ..unmodifiedText = keyCode)); 101 ..unmodifiedText = keyCode));
101 } 102 }
102 } 103 }
103 104
104 void done() { 105 void done() {
105 if (_isDone) 106 if (_isDone)
106 throw "Already done."; 107 throw "Already done.";
107 _isDone = true; 108 _isDone = true;
108 _checkComplete(); 109 _checkComplete();
109 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698