Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit 2173b98

Browse files
committed
Add Safari as test target browser, on which only memory DB is tested.
------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=81094524
1 parent 64c10d0 commit 2173b98

10 files changed

+138
-9
lines changed

dist/lovefield.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2918,7 +2918,7 @@ goog.addDependency('history/history.js', ['goog.History', 'goog.History.Event',
29182918
goog.addDependency('history/history_test.js', ['goog.HistoryTest'], ['goog.History', 'goog.dispose', 'goog.dom', 'goog.testing.jsunit', 'goog.userAgent'], false);
29192919
goog.addDependency('history/html5history.js', ['goog.history.Html5History', 'goog.history.Html5History.TokenTransformer'], ['goog.asserts', 'goog.events', 'goog.events.EventTarget', 'goog.events.EventType', 'goog.history.Event'], false);
29202920
goog.addDependency('history/html5history_test.js', ['goog.history.Html5HistoryTest'], ['goog.history.Html5History', 'goog.testing.MockControl', 'goog.testing.jsunit', 'goog.testing.mockmatchers'], false);
2921-
goog.addDependency('html/flash.js', ['goog.html.flash'], ['goog.asserts', 'goog.html.SafeHtml'], false);
2921+
goog.addDependency('html/flash.js', ['goog.html.flash'], ['goog.html.SafeHtml'], false);
29222922
goog.addDependency('html/flash_test.js', ['goog.html.flashTest'], ['goog.html.SafeHtml', 'goog.html.TrustedResourceUrl', 'goog.html.flash', 'goog.string.Const', 'goog.testing.jsunit'], false);
29232923
goog.addDependency('html/legacyconversions.js', ['goog.html.legacyconversions'], ['goog.html.SafeHtml', 'goog.html.SafeUrl', 'goog.html.TrustedResourceUrl'], false);
29242924
goog.addDependency('html/legacyconversions_test.js', ['goog.html.legacyconversionsTest'], ['goog.html.SafeHtml', 'goog.html.SafeUrl', 'goog.html.TrustedResourceUrl', 'goog.html.legacyconversions', 'goog.testing.PropertyReplacer', 'goog.testing.jsunit'], false);
@@ -3699,8 +3699,8 @@ goog.addDependency('ui/keyboardshortcuthandler_test.js', ['goog.ui.KeyboardShort
36993699
goog.addDependency('ui/labelinput.js', ['goog.ui.LabelInput'], ['goog.Timer', 'goog.a11y.aria', 'goog.a11y.aria.State', 'goog.asserts', 'goog.dom', 'goog.dom.classlist', 'goog.events.EventHandler', 'goog.events.EventType', 'goog.ui.Component', 'goog.userAgent'], false);
37003700
goog.addDependency('ui/labelinput_test.js', ['goog.ui.LabelInputTest'], ['goog.a11y.aria', 'goog.a11y.aria.State', 'goog.dom', 'goog.dom.classlist', 'goog.events.EventType', 'goog.testing.MockClock', 'goog.testing.events', 'goog.testing.events.Event', 'goog.testing.jsunit', 'goog.ui.LabelInput', 'goog.userAgent'], false);
37013701
goog.addDependency('ui/linkbuttonrenderer.js', ['goog.ui.LinkButtonRenderer'], ['goog.ui.Button', 'goog.ui.FlatButtonRenderer', 'goog.ui.registry'], false);
3702-
goog.addDependency('ui/media/flashobject.js', ['goog.ui.media.FlashObject', 'goog.ui.media.FlashObject.ScriptAccessLevel', 'goog.ui.media.FlashObject.Wmodes'], ['goog.asserts', 'goog.dom.safe', 'goog.events.Event', 'goog.events.EventHandler', 'goog.events.EventType', 'goog.html.SafeUrl', 'goog.html.TrustedResourceUrl', 'goog.html.flash', 'goog.html.legacyconversions', 'goog.log', 'goog.object', 'goog.string', 'goog.structs.Map', 'goog.style', 'goog.ui.Component', 'goog.userAgent', 'goog.userAgent.flash'], false);
3703-
goog.addDependency('ui/media/flashobject_test.js', ['goog.ui.media.FlashObjectTest'], ['goog.dom', 'goog.dom.DomHelper', 'goog.events', 'goog.events.Event', 'goog.events.EventType', 'goog.html.SafeUrl', 'goog.testing.MockControl', 'goog.testing.events', 'goog.testing.jsunit', 'goog.ui.media.FlashObject', 'goog.userAgent'], false);
3702+
goog.addDependency('ui/media/flashobject.js', ['goog.ui.media.FlashObject', 'goog.ui.media.FlashObject.ScriptAccessLevel', 'goog.ui.media.FlashObject.Wmodes'], ['goog.asserts', 'goog.events.Event', 'goog.events.EventHandler', 'goog.events.EventType', 'goog.log', 'goog.object', 'goog.string', 'goog.structs.Map', 'goog.style', 'goog.ui.Component', 'goog.userAgent', 'goog.userAgent.flash'], false);
3703+
goog.addDependency('ui/media/flashobject_test.js', ['goog.ui.media.FlashObjectTest'], ['goog.dom', 'goog.dom.DomHelper', 'goog.events', 'goog.events.Event', 'goog.events.EventType', 'goog.testing.MockControl', 'goog.testing.events', 'goog.testing.jsunit', 'goog.ui.media.FlashObject'], false);
37043704
goog.addDependency('ui/media/flickr.js', ['goog.ui.media.FlickrSet', 'goog.ui.media.FlickrSetModel'], ['goog.ui.media.FlashObject', 'goog.ui.media.Media', 'goog.ui.media.MediaModel', 'goog.ui.media.MediaRenderer'], false);
37053705
goog.addDependency('ui/media/flickr_test.js', ['goog.ui.media.FlickrSetTest'], ['goog.dom', 'goog.testing.jsunit', 'goog.ui.media.FlashObject', 'goog.ui.media.FlickrSet', 'goog.ui.media.FlickrSetModel', 'goog.ui.media.Media'], false);
37063706
goog.addDependency('ui/media/googlevideo.js', ['goog.ui.media.GoogleVideo', 'goog.ui.media.GoogleVideoModel'], ['goog.string', 'goog.ui.media.FlashObject', 'goog.ui.media.Media', 'goog.ui.media.MediaModel', 'goog.ui.media.MediaRenderer'], false);
@@ -3869,7 +3869,7 @@ goog.addDependency('useragent/product_isversion.js', ['goog.userAgent.product.is
38693869
goog.addDependency('useragent/product_test.js', ['goog.userAgent.productTest'], ['goog.array', 'goog.labs.userAgent.util', 'goog.testing.MockUserAgent', 'goog.testing.PropertyReplacer', 'goog.testing.jsunit', 'goog.userAgent', 'goog.userAgent.product', 'goog.userAgent.product.isVersion', 'goog.userAgentTestUtil'], false);
38703870
goog.addDependency('useragent/useragent.js', ['goog.userAgent'], ['goog.labs.userAgent.browser', 'goog.labs.userAgent.engine', 'goog.labs.userAgent.platform', 'goog.labs.userAgent.util', 'goog.string'], false);
38713871
goog.addDependency('useragent/useragent_quirks_test.js', ['goog.userAgentQuirksTest'], ['goog.testing.jsunit', 'goog.userAgent'], false);
3872-
goog.addDependency('useragent/useragent_test.js', ['goog.userAgentTest'], ['goog.array', 'goog.labs.userAgent.platform', 'goog.labs.userAgent.testAgents', 'goog.labs.userAgent.util', 'goog.testing.PropertyReplacer', 'goog.testing.jsunit', 'goog.userAgent', 'goog.userAgentTestUtil'], false);
3872+
goog.addDependency('useragent/useragent_test.js', ['goog.userAgentTest'], ['goog.array', 'goog.labs.userAgent.testAgents', 'goog.labs.userAgent.util', 'goog.testing.PropertyReplacer', 'goog.testing.jsunit', 'goog.userAgent', 'goog.userAgentTestUtil'], false);
38733873
goog.addDependency('useragent/useragenttestutil.js', ['goog.userAgentTestUtil', 'goog.userAgentTestUtil.UserAgents'], ['goog.labs.userAgent.browser', 'goog.labs.userAgent.engine', 'goog.labs.userAgent.platform', 'goog.userAgent', 'goog.userAgent.keyboard', 'goog.userAgent.platform', 'goog.userAgent.product', 'goog.userAgent.product.isVersion'], false);
38743874
goog.addDependency('vec/float32array.js', ['goog.vec.Float32Array'], [], false);
38753875
goog.addDependency('vec/float64array.js', ['goog.vec.Float64Array'], [], false);

perf/lf_perf_test.js

+21
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ goog.require('goog.Promise');
1919
goog.require('goog.net.XhrIo');
2020
goog.require('goog.testing.AsyncTestCase');
2121
goog.require('goog.testing.jsunit');
22+
goog.require('goog.userAgent.product');
2223
goog.require('hr.db');
2324
goog.require('lf.testing.Benchmark');
2425
goog.require('lf.testing.hrSchema.MockDataGenerator');
@@ -56,6 +57,10 @@ function benchmarkSetUp() {
5657
}
5758

5859
function test1LoadingEmptyDB() {
60+
if (goog.userAgent.product.SAFARI) {
61+
return;
62+
}
63+
5964
var test1 = new lf.testing.perf.DefaultBenchmark();
6065
var benchmark = new lf.testing.Benchmark(
6166
'Loading Empty DB',
@@ -73,6 +78,10 @@ function test1LoadingEmptyDB() {
7378
}
7479

7580
function test2FullTableOps() {
81+
if (goog.userAgent.product.SAFARI) {
82+
return;
83+
}
84+
7685
var test2 = new lf.testing.perf.DefaultBenchmark();
7786
var benchmark = new lf.testing.Benchmark(
7887
'Full table SCUD',
@@ -114,6 +123,10 @@ function test2FullTableOps() {
114123

115124

116125
function test3PKTableOps() {
126+
if (goog.userAgent.product.SAFARI) {
127+
return;
128+
}
129+
117130
var test3 = new lf.testing.perf.DefaultBenchmark();
118131
var benchmark = new lf.testing.Benchmark(
119132
'PK-based SCUD',
@@ -169,6 +182,10 @@ function test3PKTableOps() {
169182

170183

171184
function test4Select() {
185+
if (goog.userAgent.product.SAFARI) {
186+
return;
187+
}
188+
172189
asyncTestCase.waitForAsync('test4_Select');
173190

174191
var db = null;
@@ -247,6 +264,10 @@ function test4Select() {
247264

248265

249266
function test5LoadingPopulatedDB() {
267+
if (goog.userAgent.product.SAFARI) {
268+
return;
269+
}
270+
250271
asyncTestCase.waitForAsync('test5LoadingPopulatedDB');
251272
var rowCount = 20000;
252273
var test = new lf.testing.perf.DefaultBenchmark();

tests/backstore/indexed_db_raw_back_store_test.js

+49
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ goog.require('goog.Promise');
1919
goog.require('goog.testing.AsyncTestCase');
2020
goog.require('goog.testing.jsunit');
2121
goog.require('goog.testing.recordFunction');
22+
goog.require('goog.userAgent.product');
2223
goog.require('lf.Global');
2324
goog.require('lf.Row');
2425
goog.require('lf.Type');
@@ -54,6 +55,10 @@ var MAGIC = Math.pow(2, lf.backstore.Page.BUNDLE_EXPONENT);
5455

5556

5657
function setUp() {
58+
if (goog.userAgent.product.SAFARI) {
59+
return;
60+
}
61+
5762
schema = new Schema_();
5863

5964
var global = lf.Global.get();
@@ -62,6 +67,10 @@ function setUp() {
6267
}
6368

6469
function testConvert() {
70+
if (goog.userAgent.product.SAFARI) {
71+
return;
72+
}
73+
6574
var date = new Date();
6675
var buffer = new ArrayBuffer(8);
6776
var view = new Uint8Array(buffer);
@@ -83,6 +92,10 @@ function testConvert() {
8392
// Tests that onUpgrade function is still called with version 0 for a new DB
8493
// instance.
8594
function testNewDBInstance() {
95+
if (goog.userAgent.product.SAFARI) {
96+
return;
97+
}
98+
8699
asyncTestCase.waitForAsync('testNewDBInstance');
87100

88101
/**
@@ -203,6 +216,10 @@ function prepareBundledTxForTableA(db) {
203216

204217

205218
function testAddTableColumn() {
219+
if (goog.userAgent.product.SAFARI) {
220+
return;
221+
}
222+
206223
asyncTestCase.waitForAsync('testAddTableColumn');
207224

208225
var db = new lf.backstore.IndexedDB(lf.Global.get(), schema);
@@ -228,6 +245,10 @@ function testAddTableColumn() {
228245

229246

230247
function testAddTableColumn_Bundled() {
248+
if (goog.userAgent.product.SAFARI) {
249+
return;
250+
}
251+
231252
asyncTestCase.waitForAsync('testAddTableColumn_Bundled');
232253

233254
var db = new lf.backstore.IndexedDB(lf.Global.get(), schema, true);
@@ -267,6 +288,10 @@ function upgradeDropTableColumn(dbInterface) {
267288

268289

269290
function testDropTableColumn() {
291+
if (goog.userAgent.product.SAFARI) {
292+
return;
293+
}
294+
270295
asyncTestCase.waitForAsync('testDropTableColumn');
271296

272297
var db = new lf.backstore.IndexedDB(lf.Global.get(), schema);
@@ -290,6 +315,10 @@ function testDropTableColumn() {
290315

291316

292317
function testDropTableColumn_Bundled() {
318+
if (goog.userAgent.product.SAFARI) {
319+
return;
320+
}
321+
293322
asyncTestCase.waitForAsync('testDropTableColumn_Bundled');
294323

295324
var db = new lf.backstore.IndexedDB(lf.Global.get(), schema, true);
@@ -327,6 +356,10 @@ function upgradeRenameTableColumn(dbInterface) {
327356

328357

329358
function testRenameTableColumn() {
359+
if (goog.userAgent.product.SAFARI) {
360+
return;
361+
}
362+
330363
asyncTestCase.waitForAsync('testRenameTableColumn');
331364

332365
var db = new lf.backstore.IndexedDB(lf.Global.get(), schema);
@@ -352,6 +385,10 @@ function testRenameTableColumn() {
352385

353386

354387
function testRenameTableColumn_Bundled() {
388+
if (goog.userAgent.product.SAFARI) {
389+
return;
390+
}
391+
355392
asyncTestCase.waitForAsync('testRenameTableColumn_Bundled');
356393

357394
var db = new lf.backstore.IndexedDB(lf.Global.get(), schema, true);
@@ -391,6 +428,10 @@ function upgradeDropTable(dbInterface) {
391428

392429

393430
function testDropTable() {
431+
if (goog.userAgent.product.SAFARI) {
432+
return;
433+
}
434+
394435
asyncTestCase.waitForAsync('testDropTable');
395436

396437
var db = new lf.backstore.IndexedDB(lf.Global.get(), schema);
@@ -424,6 +465,10 @@ function upgradeDumping(dbInterface) {
424465

425466

426467
function testDump() {
468+
if (goog.userAgent.product.SAFARI) {
469+
return;
470+
}
471+
427472
asyncTestCase.waitForAsync('testDump');
428473

429474
var db = new lf.backstore.IndexedDB(lf.Global.get(), schema);
@@ -442,6 +487,10 @@ function testDump() {
442487

443488

444489
function testDump_Bundled() {
490+
if (goog.userAgent.product.SAFARI) {
491+
return;
492+
}
493+
445494
asyncTestCase.waitForAsync('testDump_Bundled');
446495

447496
var db = new lf.backstore.IndexedDB(lf.Global.get(), schema, true);

tests/backstore/indexeddb_test.js

+33
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ goog.setTestOnly();
1818
goog.require('goog.Promise');
1919
goog.require('goog.testing.AsyncTestCase');
2020
goog.require('goog.testing.jsunit');
21+
goog.require('goog.userAgent.product');
2122
goog.require('lf.Global');
2223
goog.require('lf.Row');
2324
goog.require('lf.TransactionType');
@@ -50,6 +51,10 @@ var db;
5051

5152

5253
function setUp() {
54+
if (goog.userAgent.product.SAFARI) {
55+
return;
56+
}
57+
5358
cache = new lf.cache.DefaultCache();
5459
schema = new lf.testing.MockSchema();
5560
indexStore = new lf.index.MemoryIndexStore();
@@ -60,6 +65,10 @@ function setUp() {
6065

6166

6267
function tearDown() {
68+
if (goog.userAgent.product.SAFARI) {
69+
return;
70+
}
71+
6372
asyncTestCase.waitForAsync('tearDown');
6473

6574
// Clearing all tables.
@@ -172,6 +181,10 @@ function runSCUDTest() {
172181
}
173182

174183
function testSCUD() {
184+
if (goog.userAgent.product.SAFARI) {
185+
return;
186+
}
187+
175188
db = new lf.backstore.IndexedDB(lf.Global.get(), schema);
176189
runSCUDTest().then(function() {
177190
asyncTestCase.continueTesting();
@@ -181,6 +194,10 @@ function testSCUD() {
181194
}
182195

183196
function testSCUD_Bundled() {
197+
if (goog.userAgent.product.SAFARI) {
198+
return;
199+
}
200+
184201
schema.name = schema.name + '_bundled';
185202
db = new lf.backstore.IndexedDB(lf.Global.get(), schema, true);
186203
runSCUDTest().then(function() {
@@ -191,6 +208,10 @@ function testSCUD_Bundled() {
191208
}
192209

193210
function testTwoTableInserts_Bundled() {
211+
if (goog.userAgent.product.SAFARI) {
212+
return;
213+
}
214+
194215
schema.name = schema.name + '_b2';
195216
db = new lf.backstore.IndexedDB(lf.Global.get(), schema, true);
196217

@@ -284,6 +305,10 @@ function testTwoTableInserts_Bundled() {
284305

285306
/** @suppress {accessControls} */
286307
function testScanRowId() {
308+
if (goog.userAgent.product.SAFARI) {
309+
return;
310+
}
311+
287312
/** @return {!IThenable} */
288313
var insertIntoTable = function() {
289314
var CONTENTS = {'scan': 'rowid'};
@@ -324,6 +349,10 @@ function testScanRowId() {
324349

325350
/** @suppress {accessControls} */
326351
function testScanRowId_BundledDB() {
352+
if (goog.userAgent.product.SAFARI) {
353+
return;
354+
}
355+
327356
/** @return {!IThenable} */
328357
var insertIntoTable = function() {
329358
var CONTENTS = {'scan': 'rowid'};
@@ -371,6 +400,10 @@ function selectAll() {
371400
}
372401

373402
function testUpgrade() {
403+
if (goog.userAgent.product.SAFARI) {
404+
return;
405+
}
406+
374407
// Randomize schema name to ensure upgrade test works.
375408
var name = schema.name + goog.now();
376409
schema.name = name;

tests/bundled_crud_test.js

+17
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ goog.setTestOnly();
1818
goog.require('goog.Promise');
1919
goog.require('goog.testing.AsyncTestCase');
2020
goog.require('goog.testing.jsunit');
21+
goog.require('goog.userAgent.product');
2122
goog.require('hr.bdb');
2223
goog.require('lf.Exception');
2324
goog.require('lf.Global');
@@ -44,6 +45,10 @@ var r;
4445

4546

4647
function setUp() {
48+
if (goog.userAgent.product.SAFARI) {
49+
return;
50+
}
51+
4752
asyncTestCase.waitForAsync('setUp');
4853
hr.bdb.getInstance().then(
4954
function(database) {
@@ -78,6 +83,10 @@ function clearDb() {
7883
* Smoke test for the most basic DB operations, Create, Read, Update, Delete.
7984
*/
8085
function testCRUD() {
86+
if (goog.userAgent.product.SAFARI) {
87+
return;
88+
}
89+
8190
asyncTestCase.waitForAsync('testCRUD');
8291

8392
var regionRows = generateSampleRows();
@@ -209,6 +218,10 @@ function testCRUD() {
209218
* manner.
210219
*/
211220
function testOverlappingScope_MultipleInserts() {
221+
if (goog.userAgent.product.SAFARI) {
222+
return;
223+
}
224+
212225
// TODO(arthurhsu): add a new test case to test failure case.
213226
asyncTestCase.waitForAsync('testOverlappingScope_MultipleInserts');
214227
var rowCount = 3;
@@ -250,6 +263,10 @@ function testOverlappingScope_MultipleInserts() {
250263
* Smoke test for transactions.
251264
*/
252265
function testTransaction() {
266+
if (goog.userAgent.product.SAFARI) {
267+
return;
268+
}
269+
253270
var rows = generateSampleRows();
254271
var r = db.getSchema().getRegion();
255272
var tx = db.createTransaction(lf.TransactionType.READ_WRITE);

0 commit comments

Comments
 (0)