diff --git a/chrome/test/data/pdf/basic_plugin_test.ts b/chrome/test/data/pdf/basic_plugin_test.ts index 9a4e578758637c..cbf97aa45ecded 100644 --- a/chrome/test/data/pdf/basic_plugin_test.ts +++ b/chrome/test/data/pdf/basic_plugin_test.ts @@ -7,7 +7,7 @@ import {PDFScriptingAPI, PDFViewerElement} from 'chrome-extension://mhjfbmdgcfjb /** * These tests require that the PDF plugin be available to run correctly. */ -const tests = [ +chrome.test.runTests([ /** * Test that the page is sized to the size of the document. */ @@ -38,9 +38,4 @@ const tests = [ chrome.test.assertEq('test.pdf', document.title); chrome.test.succeed(); }, -]; - -const scriptingAPI = new PDFScriptingAPI(window, window); -scriptingAPI.setLoadCompleteCallback(function() { - chrome.test.runTests(tests); -}); +]); diff --git a/chrome/test/data/pdf/beep_test.ts b/chrome/test/data/pdf/beep_test.ts index 92bf328c11b43a..5668bd2b5a52ad 100644 --- a/chrome/test/data/pdf/beep_test.ts +++ b/chrome/test/data/pdf/beep_test.ts @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {PDFScriptingAPI, PDFViewerElement} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; +import {PDFViewerElement} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; -const tests = [ +chrome.test.runTests([ /** * Test that the JS was able to call back via "app.beep()" */ @@ -13,9 +13,4 @@ const tests = [ chrome.test.assertEq(1, viewer.beepCount); chrome.test.succeed(); } -]; - -const scriptingAPI = new PDFScriptingAPI(window, window); -scriptingAPI.setLoadCompleteCallback(function() { - chrome.test.runTests(tests); -}); +]); diff --git a/chrome/test/data/pdf/bookmarks_test.ts b/chrome/test/data/pdf/bookmarks_test.ts index 8faab5f263d267..c5ea8074a301df 100644 --- a/chrome/test/data/pdf/bookmarks_test.ts +++ b/chrome/test/data/pdf/bookmarks_test.ts @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {Bookmark, ChangePageAndXyDetail, ChangePageDetail, ChangeZoomDetail, NavigateDetail, PDFScriptingAPI} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; +import {Bookmark, ChangePageAndXyDetail, ChangePageDetail, ChangeZoomDetail, NavigateDetail} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {createBookmarksForTest} from './test_util.js'; @@ -13,7 +13,7 @@ interface TestBookmarksElement extends HTMLElement { bookmarks: Bookmark[]; } -const tests = [ +chrome.test.runTests([ /** * Test that the correct bookmarks were loaded for * test-bookmarks-with-zoom.pdf. @@ -150,9 +150,4 @@ const tests = [ chrome.test.succeed(); } -]; - -const scriptingAPI = new PDFScriptingAPI(window, window); -scriptingAPI.setLoadCompleteCallback(function() { - chrome.test.runTests(tests); -}); +]); diff --git a/chrome/test/data/pdf/navigator_test.ts b/chrome/test/data/pdf/navigator_test.ts index 41e83e9ed30373..394c42528877c8 100644 --- a/chrome/test/data/pdf/navigator_test.ts +++ b/chrome/test/data/pdf/navigator_test.ts @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {NavigatorDelegate, OpenPdfParamsParser, PdfNavigator, PDFScriptingAPI, WindowOpenDisposition} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; +import {NavigatorDelegate, OpenPdfParamsParser, PdfNavigator, WindowOpenDisposition} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; import {TestBrowserProxy} from 'chrome://webui-test/test_browser_proxy.js'; import {getZoomableViewport, MockDocumentDimensions, MockElement, MockSizer, MockViewportChangedCallback} from './test_util.js'; @@ -99,7 +99,7 @@ async function doNavigationUrlTests( mockViewportChangedCallback, navigatorDelegate); } -const tests = [ +chrome.test.runTests([ /** * Test navigation within the page, opening a url in the same tab and * opening a url in a new tab. @@ -255,9 +255,4 @@ const tests = [ chrome.test.succeed(); } -]; - -const scriptingAPI = new PDFScriptingAPI(window, window); -scriptingAPI.setLoadCompleteCallback(function() { - chrome.test.runTests(tests); -}); +]); diff --git a/chrome/test/data/pdf/nobeep_test.ts b/chrome/test/data/pdf/nobeep_test.ts index 5cb13ca9d17f0d..8903ced5a9f3bd 100644 --- a/chrome/test/data/pdf/nobeep_test.ts +++ b/chrome/test/data/pdf/nobeep_test.ts @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {PDFScriptingAPI, PDFViewerElement} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; +import {PDFViewerElement} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; -const tests = [ +chrome.test.runTests([ /** * Test that blocked JS was not able to call back via "app.beep()" */ @@ -13,9 +13,4 @@ const tests = [ chrome.test.assertEq(0, viewer.beepCount); chrome.test.succeed(); } -]; - -const scriptingAPI = new PDFScriptingAPI(window, window); -scriptingAPI.setLoadCompleteCallback(function() { - chrome.test.runTests(tests); -}); +]); diff --git a/chrome/test/data/pdf/params_parser_test.ts b/chrome/test/data/pdf/params_parser_test.ts index 4a0470da20ccae..68c093aa8883f9 100644 --- a/chrome/test/data/pdf/params_parser_test.ts +++ b/chrome/test/data/pdf/params_parser_test.ts @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {FittingType, OpenPdfParamsParser, PDFScriptingAPI} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; +import {FittingType, OpenPdfParamsParser} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; -const tests = [ +chrome.test.runTests([ /** * Test named destinations. */ @@ -319,9 +319,4 @@ const tests = [ chrome.test.succeed(); } -]; - -const scriptingAPI = new PDFScriptingAPI(window, window); -scriptingAPI.setLoadCompleteCallback(function() { - chrome.test.runTests(tests); -}); +]); diff --git a/chrome/test/data/pdf/title_test.ts b/chrome/test/data/pdf/title_test.ts index 0716e3b37fa067..906031e9084f84 100644 --- a/chrome/test/data/pdf/title_test.ts +++ b/chrome/test/data/pdf/title_test.ts @@ -2,9 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {PDFScriptingAPI} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; - -const tests = [ +chrome.test.runTests([ /** * Test that the correct title is displayed for test-title.pdf. */ @@ -13,9 +11,4 @@ const tests = [ chrome.test.succeed(); } -]; - -const scriptingAPI = new PDFScriptingAPI(window, window); -scriptingAPI.setLoadCompleteCallback(function() { - chrome.test.runTests(tests); -}); +]); diff --git a/chrome/test/data/pdf/touch_handling_test.js b/chrome/test/data/pdf/touch_handling_test.js index b4f162af4f2dfc..45d43bb253649c 100644 --- a/chrome/test/data/pdf/touch_handling_test.js +++ b/chrome/test/data/pdf/touch_handling_test.js @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {PDFScriptingAPI} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; - function sendTouchStart(touches) { let id = 0; const touchList = touches.map(function(xy) { @@ -36,7 +34,7 @@ function createContextMenuEvent() { }); } -const tests = [ +chrome.test.runTests([ // Test suppression of the context menu on single touch. function testContextMenuSingleTouch() { sendTouchStart([{x: 10, y: 10}]); @@ -77,9 +75,4 @@ const tests = [ // // 10k is the value for the action_timeout_ms_ in Chrome test_timeouts.cc // }, 10000); // } -]; - -const scriptingAPI = new PDFScriptingAPI(window, window); -scriptingAPI.setLoadCompleteCallback(function() { - chrome.test.runTests(tests); -}); +]); diff --git a/chrome/test/data/pdf/whitespace_title_test.ts b/chrome/test/data/pdf/whitespace_title_test.ts index fee4f25dd91717..36f74a8d74dda0 100644 --- a/chrome/test/data/pdf/whitespace_title_test.ts +++ b/chrome/test/data/pdf/whitespace_title_test.ts @@ -2,9 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {PDFScriptingAPI} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; - -const tests = [ +chrome.test.runTests([ /** * Test that the correct title is displayed for test-whitespace-title.pdf. */ @@ -13,9 +11,4 @@ const tests = [ chrome.test.succeed(); } -]; - -const scriptingAPI = new PDFScriptingAPI(window, window); -scriptingAPI.setLoadCompleteCallback(function() { - chrome.test.runTests(tests); -}); +]);