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

Side by Side Diff: perf/server/tests/oobserve.js

Issue 380733002: Add the Polymer object observe library and add a test that it works. (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « perf/server/res/js/logic.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 describe('Confirm our polyfill of Object Observe works.',
2 function() {
3 beforeEach(function() { });
4 afterEach(function() { });
5
6 function testSimpleOO() {
7 // Let's say we have a model with data
8 var model = {};
9
10 var observations = [];
11
12 var observer = new ObjectObserver(model);
13 // Which we then observe
14 observer.open(function(added, removed, changed, getOldValueFn){
15 Object.keys(added).forEach(function(change) {
16 observations.push(change);
17 });
18 });
19 model["foo"] = "bar";
20 assert.equal(0, observations.length, "Observations should have been added. ")
21
22 Platform.performMicrotaskCheckpoint()
23
24 assert.equal(1, observations.length, "Observations should have been added. ")
25 }
26
27
28 it('should be able to use ObjectObserver', function() {
29 testSimpleOO();
30 });
31 }
32 );
OLDNEW
« no previous file with comments | « perf/server/res/js/logic.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698