Commit fb2cfedb authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

WebSQL: Add LayoutTests for blocked SQLite FTS3 features.

Chrome patches SQLite to remove two features from the FTS3 extension.
This CL adds LayoutTests verifying that the features are not available
to WebSQL. The tests ensure that we won't accidentally expose the
features as we shed our SQLite patches.

Bug: 945204
Change-Id: I50364520c33bdfbbbc9b5521fcf6dff37d9fe419
Tested: Ran the blocked commands in a vanilla sqlite3 shell.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538864
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarDarwin Huang <huangdarwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644644}
parent f3912b21
<!doctype html>
<meta charset="utf-8">
<title>WebSQL: fts3_tokenizer() is not allowed</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
'use strict';
async_test(testCase => {
const database = openDatabase(
'Fts3TokenizerNotAllowedTest', '1.0',
'Database for fts3_tokenizer() blocking test', 1024 * 1024);
assert_not_equals(database, null, 'openDatabase should not fail');
database.transaction(testCase.step_func(transaction => {
transaction.executeSql(
'SELECT fts3_tokenizer("simple");', [],
testCase.unreached_func('fts3_tokenizer() usage should not succeed'),
testCase.step_func_done());
}));
}, 'fts3_tokenizer() function calls should not be allowed');
</script>
<!doctype html>
<meta charset="utf-8">
<title>WebSQL: FTS4 is not allowed</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
'use strict';
async_test(testCase => {
const database = openDatabase(
'Fts4NotAllowedTest', '1.0', 'Database for FTS4 blocking test',
1024 * 1024);
assert_not_equals(database, null, 'openDatabase should not fail');
database.transaction(testCase.step_func(transaction => {
transaction.executeSql(
'DROP TABLE IF EXISTS main;', [], () => {},
testCase.unreached_func('Table drop should not fail'));
transaction.executeSql(
'CREATE VIRTUAL TABLE main USING FTS4(fts4table);', [],
testCase.unreached_func('FTS4 usage should not succeed'),
testCase.step_func_done());
}));
}, 'FTS4 table creation should not be allowed');
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment