Skip to content

Commit

Permalink
tests(devtools): ensure WebSQL table is populated (#13579)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine committed Jan 19, 2022
1 parent 82772f9 commit 62848fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

await TestRunner.loadTestModule('lighthouse_test_runner');
await TestRunner.showPanel('lighthouse');
await TestRunner.RuntimeAgent.invoke_evaluate({
expression: 'webSqlPromise',
awaitPromise: true,
});

const containerElement = LighthouseTestRunner.getContainerElement();
const checkboxes = containerElement.querySelectorAll('.checkbox');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

// WebSQL
var db = openDatabase('mydb', '1.0', 'Test', 2 * 1024 * 1024);
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)');
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (1, "foobar")');
var webSqlPromise = new Promise(resolve => {
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)');
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (1, "foobar")', [], resolve);
});
});
</script>
</head>
Expand Down

0 comments on commit 62848fb

Please sign in to comment.