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

Side by Side Diff: tests/try/web/mock_try.dart

Issue 2232273004: Delete site/try (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:html' show
6 DivElement,
7 MutationObserver,
8 document;
9
10 import 'package:try/src/interaction_manager.dart' show
11 InteractionManager;
12
13 import 'package:try/src/ui.dart' show
14 hackDiv,
15 mainEditorPane,
16 observer;
17
18 import 'package:try/src/user_option.dart' show
19 UserOption;
20
21 InteractionManager mockTryDartInteraction() {
22 UserOption.storage = {};
23
24 InteractionManager interaction = new InteractionManager();
25
26 hackDiv = new DivElement();
27 mainEditorPane = new DivElement()
28 ..style.whiteSpace = 'pre'
29 ..contentEditable = 'true';
30
31 observer = new MutationObserver(interaction.onMutation);
32 observer.observe(
33 mainEditorPane, childList: true, characterData: true, subtree: true);
34
35 document.body.nodes.addAll([mainEditorPane, hackDiv]);
36
37 return interaction;
38 }
39
40 void clearEditorPaneWithoutNotifications() {
41 mainEditorPane.nodes.clear();
42 observer.takeRecords();
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698