Skip to content

Commit 040fbf4

Browse files
[AUTOMATED]: Prettier Code Styling
1 parent e67d030 commit 040fbf4

7 files changed

+536
-1
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
Index: test/unit/local/indexeddb_schema.test.ts
2+
IDEA additional info:
3+
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
4+
<+>UTF-8
5+
===================================================================
6+
--- test/unit/local/indexeddb_schema.test.ts (date 1521229629000)
7+
+++ test/unit/local/indexeddb_schema.test.ts (date 1521229629000)
8+
@@ -21,7 +21,9 @@
9+
createOrUpgradeDb,
10+
DbTarget,
11+
DbTargetGlobal,
12+
- DbTargetGlobalKey
13+
+ DbTargetGlobalKey,
14+
+ V1_STORES,
15+
+ V2_STORES
16+
} from '../../../src/local/indexeddb_schema';
17+
import { SimpleDb, SimpleDbTransaction } from '../../../src/local/simple_db';
18+
import { PersistencePromise } from '../../../src/local/persistence_promise';
19+
@@ -88,11 +90,10 @@
20+
beforeEach(() => SimpleDb.delete(INDEXEDDB_TEST_DATABASE));
21+
22+
it('can install schema version 1', () => {
23+
- return withDb(1, db => {
24+
+ return withDb(1, async db => {
25+
expect(db.version).to.equal(1);
26+
// Version 1 adds all of the stores so far.
27+
- expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
28+
- return Promise.resolve();
29+
+ expect(getAllObjectStores(db)).to.have.members(V1_STORES);
30+
});
31+
});
32+
33+
@@ -101,7 +102,7 @@
34+
expect(db.version).to.equal(2);
35+
// We should have all of the stores, we should have the target global row
36+
// and we should not have any targets counted, because there are none.
37+
- expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
38+
+ expect(getAllObjectStores(db)).to.have.members(V2_STORES);
39+
// Check the target count. We haven't added any targets, so we expect 0.
40+
return getTargetCount(db).then(targetCount => {
41+
expect(targetCount).to.equal(0);
42+
@@ -109,6 +110,13 @@
43+
});
44+
});
45+
46+
+ it('can install schema version 3', () => {
47+
+ return withDb(3, async db => {
48+
+ expect(db.version).to.be.equal(3);
49+
+ expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
50+
+ });
51+
+ });
52+
+
53+
it('can upgrade from schema version 1 to 2', () => {
54+
const expectedTargetCount = 5;
55+
return withDb(1, db => {
56+
@@ -126,11 +134,20 @@
57+
}).then(() =>
58+
withDb(2, db => {
59+
expect(db.version).to.equal(2);
60+
- expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
61+
+ expect(getAllObjectStores(db)).to.have.members(V2_STORES);
62+
return getTargetCount(db).then(targetCount => {
63+
expect(targetCount).to.equal(expectedTargetCount);
64+
});
65+
})
66+
);
67+
});
68+
+
69+
+ it('can upgrade from schema version 2 to 3', () => {
70+
+ return withDb(2, async () => {}).then(() =>
71+
+ withDb(3, async db => {
72+
+ expect(db.version).to.be.equal(3);
73+
+ expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
74+
+ })
75+
+ );
76+
+ });
77+
});
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
Index: test/unit/local/indexeddb_schema.test.ts
2+
IDEA additional info:
3+
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
4+
<+>UTF-8
5+
===================================================================
6+
--- test/unit/local/indexeddb_schema.test.ts (date 1521229629000)
7+
+++ test/unit/local/indexeddb_schema.test.ts (date 1521229629000)
8+
@@ -21,7 +21,9 @@
9+
createOrUpgradeDb,
10+
DbTarget,
11+
DbTargetGlobal,
12+
- DbTargetGlobalKey
13+
+ DbTargetGlobalKey,
14+
+ V1_STORES,
15+
+ V2_STORES
16+
} from '../../../src/local/indexeddb_schema';
17+
import { SimpleDb, SimpleDbTransaction } from '../../../src/local/simple_db';
18+
import { PersistencePromise } from '../../../src/local/persistence_promise';
19+
@@ -88,11 +90,10 @@
20+
beforeEach(() => SimpleDb.delete(INDEXEDDB_TEST_DATABASE));
21+
22+
it('can install schema version 1', () => {
23+
- return withDb(1, db => {
24+
+ return withDb(1, async db => {
25+
expect(db.version).to.equal(1);
26+
// Version 1 adds all of the stores so far.
27+
- expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
28+
- return Promise.resolve();
29+
+ expect(getAllObjectStores(db)).to.have.members(V1_STORES);
30+
});
31+
});
32+
33+
@@ -101,7 +102,7 @@
34+
expect(db.version).to.equal(2);
35+
// We should have all of the stores, we should have the target global row
36+
// and we should not have any targets counted, because there are none.
37+
- expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
38+
+ expect(getAllObjectStores(db)).to.have.members(V2_STORES);
39+
// Check the target count. We haven't added any targets, so we expect 0.
40+
return getTargetCount(db).then(targetCount => {
41+
expect(targetCount).to.equal(0);
42+
@@ -109,6 +110,13 @@
43+
});
44+
});
45+
46+
+ it('can install schema version 3', () => {
47+
+ return withDb(3, async db => {
48+
+ expect(db.version).to.be.equal(3);
49+
+ expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
50+
+ });
51+
+ });
52+
+
53+
it('can upgrade from schema version 1 to 2', () => {
54+
const expectedTargetCount = 5;
55+
return withDb(1, db => {
56+
@@ -126,11 +134,20 @@
57+
}).then(() =>
58+
withDb(2, db => {
59+
expect(db.version).to.equal(2);
60+
- expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
61+
+ expect(getAllObjectStores(db)).to.have.members(V2_STORES);
62+
return getTargetCount(db).then(targetCount => {
63+
expect(targetCount).to.equal(expectedTargetCount);
64+
});
65+
})
66+
);
67+
});
68+
+
69+
+ it('can upgrade from schema version 2 to 3', () => {
70+
+ return withDb(2, async () => {}).then(() =>
71+
+ withDb(3, async db => {
72+
+ expect(db.version).to.be.equal(3);
73+
+ expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
74+
+ })
75+
+ );
76+
+ });
77+
});
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Index: src/util/async_queue.ts
2+
IDEA additional info:
3+
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
4+
<+>UTF-8
5+
===================================================================
6+
--- src/util/async_queue.ts (date 1521229072000)
7+
+++ src/util/async_queue.ts (date 1521229072000)
8+
@@ -31,13 +31,6 @@
9+
* The string values are used when encoding these timer IDs in JSON spec tests.
10+
*/
11+
export enum TimerId {
12+
-<<<<<<< HEAD
13+
- ListenStreamIdle,
14+
- ListenStreamConnection,
15+
- WriteStreamIdle,
16+
- WriteStreamConnection,
17+
- ClientMetadataRefresh
18+
-=======
19+
/** All can be used with runDelayedOperationsEarly() to run all timers. */
20+
All = 'all',
21+
22+
@@ -57,8 +50,13 @@
23+
* OnlineState.Unknown to Offline after a set timeout, rather than waiting
24+
* indefinitely for success or failure.
25+
*/
26+
- OnlineStateTimeout = 'online_state_timeout'
27+
->>>>>>> master
28+
+ OnlineStateTimeout = 'online_state_timeout',
29+
+
30+
+ /**
31+
+ * A timer used to update the client metadata in IndexedDb, which is used
32+
+ * to determine the primary leaseholder.
33+
+ */
34+
+ ClientMetadataRefresh = 'client_metadata_refresh'
35+
}
36+
37+
/**
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
Index: test/unit/specs/spec_builder.ts
2+
IDEA additional info:
3+
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
4+
<+>UTF-8
5+
===================================================================
6+
--- test/unit/specs/spec_builder.ts (date 1521229074000)
7+
+++ test/unit/specs/spec_builder.ts (date 1521229074000)
8+
@@ -196,7 +196,6 @@
9+
return this;
10+
}
11+
12+
-<<<<<<< HEAD
13+
// PORTING NOTE: Only used by web multi-tab tests.
14+
becomeHidden(): SpecBuilder {
15+
this.nextStep();
16+
@@ -212,11 +211,12 @@
17+
this.currentStep = {
18+
applyClientState: { visibility: 'visible' }
19+
};
20+
-=======
21+
+ return this;
22+
+ }
23+
+
24+
runTimer(timerId: TimerId) {
25+
this.nextStep();
26+
this.currentStep = { runTimer: timerId };
27+
->>>>>>> master
28+
return this;
29+
}
30+
31+
@@ -260,17 +260,6 @@
32+
this.resetInMemoryState();
33+
return this;
34+
}
35+
-
36+
- // TODO: Replace with .runTimer(TimerId.ClientStateRefresh) once #412 is
37+
- // merged.
38+
- // PORTING NOTE: Only used by web multi-tab tests.
39+
- tryAcquirePrimaryLease(): SpecBuilder {
40+
- this.nextStep();
41+
- this.currentStep = {
42+
- acquirePrimaryLease: true
43+
- };
44+
- return this;
45+
- }
46+
47+
shutdown(): SpecBuilder {
48+
this.nextStep();
49+
@@ -791,6 +780,11 @@
50+
super.becomeVisible();
51+
return this;
52+
}
53+
+
54+
+ runTimer(timerId: TimerId) {
55+
+ super.runTimer(timerId);
56+
+ return this;
57+
+ }
58+
59+
changeUser(uid: string | null): MultiClientSpecBuilder {
60+
super.changeUser(uid);
61+
@@ -811,11 +805,6 @@
62+
super.restart();
63+
return this;
64+
}
65+
-
66+
- tryAcquirePrimaryLease(): MultiClientSpecBuilder {
67+
- super.tryAcquirePrimaryLease();
68+
- return this;
69+
- }
70+
71+
expectActiveTargets(...targets): MultiClientSpecBuilder {
72+
super.expectActiveTargets(...targets);
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Index: test/unit/specs/spec_test_runner.ts
2+
IDEA additional info:
3+
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
4+
<+>UTF-8
5+
===================================================================
6+
--- test/unit/specs/spec_test_runner.ts (date 1521222146000)
7+
+++ test/unit/specs/spec_test_runner.ts (date 1521222146000)
8+
@@ -479,9 +479,6 @@
9+
return step.enableNetwork!
10+
? this.doEnableNetwork()
11+
: this.doDisableNetwork();
12+
- } else if ('acquirePrimaryLease' in step) {
13+
- // PORTING NOTE: Only used by web multi-tab tests.
14+
- return this.doAcquirePrimaryLease();
15+
} else if ('restart' in step) {
16+
return this.doRestart();
17+
} else if ('shutdown' in step) {
18+
@@ -797,14 +794,6 @@
19+
await this.remoteStore.enableNetwork();
20+
}
21+
22+
- private async doAcquirePrimaryLease(): Promise<void> {
23+
- // We drain the queue after running the client metadata refresh task as the
24+
- // refresh might schedule a primary state callback on the queue as well.
25+
- return this.queue
26+
- .runDelayedOperationsEarly(TimerId.ClientMetadataRefresh)
27+
- .then(() => this.queue.drain());
28+
- }
29+
-
30+
private async doShutdown(): Promise<void> {
31+
await this.remoteStore.shutdown();
32+
await this.persistence.shutdown();
33+
@@ -1040,7 +1029,6 @@
34+
}
35+
}
36+
37+
-<<<<<<< HEAD
38+
/**
39+
* `Document` mock that implements the `visibilitychange` API used by Firestore.
40+
*/
41+
@@ -1071,10 +1059,6 @@
42+
if (this.visibilityListener) {
43+
this.visibilityListener(new Event('visibilitychange'));
44+
}
45+
-=======
46+
- protected async destroyPersistence(): Promise<void> {
47+
- // Nothing to do.
48+
->>>>>>> master
49+
}
50+
}
51+

0 commit comments

Comments
 (0)