Skip to content

Commit

Permalink
Browser platform updates
Browse files Browse the repository at this point in the history
XXX TBD TODOs:
- tests do not always check actual results on browser
- document some behavior differences
- TBD open/close/delete
- TODO fix self test
- check that tests continue to pass on other platforms
- run tests on Chrome browser on Windows
  • Loading branch information
Christopher J. Brody committed May 1, 2017
1 parent 01ff6f6 commit 6dfe01c
Show file tree
Hide file tree
Showing 10 changed files with 505 additions and 118 deletions.
12 changes: 6 additions & 6 deletions spec/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@
<script src="spec/db-tx-sql-select-value-test.js"></script>
<script src="spec/basic-db-tx-sql-storage-results.js"></script>
<script src="spec/db-sql-operations-test.js"></script>
<!-- XXX TODO:
<!-- XXX TODO FIX TESTS:
<script src="spec/sql-batch-test.js"></script>
-->
-->
<script src="spec/db-tx-sql-features-test.js"></script>
<script src="spec/regexp-test.js"></script>
<!-- XXX TODO:
<script src="spec/db-simultaneous-tx-access-test.js"></script>
-->
<script src="spec/db-tx-multiple-update-test.js"></script>
<!-- XXX TODO:
<script src="spec/tx-semantics-test.js"></script>
<script src="spec/db-tx-error-handling-test.js"></script>
<!-- XXX TODO FIX TESTS:
<script src="spec/db-tx-value-bindings-test.js"></script>
-->
<script src="spec/db-tx-error-mapping-test.js"></script>
<!-- XXX TODO:
<script src="spec/db-open-close-delete-test.js"></script>
-->
-->
<script src="spec/ext-tx-blob-test.js"></script>

</head>
Expand Down
24 changes: 12 additions & 12 deletions spec/www/spec/db-sql-operations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var isWindows = /Windows /.test(navigator.userAgent); // Windows
var isAndroid = !isWindows && /Android/.test(navigator.userAgent);
var isBrowser = !isWindows && !isAndroid && /Chrome/.test(navigator.userAgent);
var isMac = !isBrowser && /Macintosh/.test(navigator.userAgent);
var isWKWebView = !isWindows && !isAndroid && !isWP8 && !isMac && !!window.webkit && !!window.webkit.messageHandlers;
var isWKWebView = !isWindows && !isAndroid && !isWP8 && !isMac && !isBrowser && !!window.webkit && !!window.webkit.messageHandlers;

// NOTE: In the common storage-master branch there is no difference between the
// default implementation and implementation #2. But the test will also apply
Expand Down Expand Up @@ -774,6 +774,8 @@ var mytests = function() {
}, MYTIMEOUT);

it(suiteName + 'SELECT UPPER(?) AS upper1, UPPER(?) AS upper2 with "naive" Array subclass (constructor explicitly set to subclasss) as value arguments array', function(done) {
if (isBrowser) pending('SKIP for browser platform'); // XXX TBD

var db = openDatabase('DB-SQL-SELECT-multi-upper-on-array-subclass-explicit-constructor.db');
expect(db).toBeDefined();

Expand Down Expand Up @@ -808,9 +810,13 @@ var mytests = function() {
}
db.close(done, done);
}, function(error) {
// NOT EXPECTED:
expect(false).toBe(true);
expect(error.message).toBe('--');
// EXPECTED for browser platform ONLY:
if (!isWebSql && isBrowser) {
expect(error).toBeDefined();
} else {
expect(false).toBe(true);
expect(error.message).toBe('--');
}
db.close(done, done);
});
}, MYTIMEOUT);
Expand Down Expand Up @@ -1370,10 +1376,7 @@ var mytests = function() {
}, function(error) {
// EXPECTED RESULT
expect(error).toBeDefined();
if (isBrowser)
expect(error.code).not.toBeDefined();
else
expect(error.code).toBeDefined();
expect(error.code).toBeDefined();
expect(error.message).toBeDefined();
db.close(done, done);
});
Expand All @@ -1395,10 +1398,7 @@ var mytests = function() {
}, function(error) {
// EXPECTED RESULT
expect(error).toBeDefined();
if (isBrowser)
expect(error.code).not.toBeDefined();
else
expect(error.code).toBeDefined();
expect(error.code).toBeDefined();
expect(error.message).toBeDefined();
db.close(done, done);
});
Expand Down
Loading

0 comments on commit 6dfe01c

Please sign in to comment.