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

Side by Side Diff: third_party/pkg/route_hierarchical/test/mocks.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 library test_mocks;
6
7 import 'dart:html';
8 import 'package:unittest/mock.dart';
9
10 class MockWindow extends Mock implements Window {
11 MockHistory history = new MockHistory();
12 MockLocation location = new MockLocation();
13 MockDocument document = new MockDocument();
14 }
15
16 class MockHistory extends Mock implements History {
17 //TODO(pavelgj): ugly hack for making tests run in dart2js
18 void pushState(Object data, String title, [String url]) {
19 log.add(new LogEntry(name, 'pushState', [data, title, url], Action.IGNORE));
20 }
21
22 //TODO(pavelgj): ugly hack for making tests run in dart2js
23 void replaceState(Object data, String title, [String url]) {
24 log.add(new LogEntry(name, 'replaceState', [data, title, url], Action.IGNORE ));
25 }
26 }
27
28 class MockLocation extends Mock implements Location {}
29
30 class MockDocument extends Mock implements HtmlDocument {
31 //TODO(pavelgj): ugly hack for making tests run in dart2js
32 String set title(title) =>
33 log.add(new LogEntry(name, '=title', [title], Action.IGNORE));
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698