js2gtest_support.externs.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. /**
  5. * @fileoverview @externs
  6. * Scrappy externs file to support browsertest.js compilation in media_app_ui.
  7. * These functions are added to the global `this` object using code in
  8. * test_api.js that goes like:
  9. *
  10. * (function(exports) {
  11. * // Lots more.
  12. * exports.TEST_F = TEST_F;
  13. * })(this);
  14. *
  15. * Closure doesn't really know what to do about that. Test fixtures based on
  16. * mocha consume the assertFoo methods via a separate JS module (chai_assert.js)
  17. * but we need to inject our tests into a sandboxed iframe with a tight CSP, and
  18. * that may be incompatible with modules without more complexities.
  19. * See also https://crbug.com/1000989#c22 and b/160274783.
  20. */
  21. function GEN(s) {}
  22. function TEST_F(fixture, testCase, Function) {}
  23. function GUEST_TEST(testCase, Function) {}
  24. const testing = {
  25. Test: class {
  26. get browsePreload() {}
  27. get testGenPreamble() {}
  28. get extraLibraries() {}
  29. get isAsync() {}
  30. get featureList() {}
  31. get typedefCppFixture() {}
  32. setUp() {}
  33. },
  34. };
  35. function testDone() {}
  36. function assertEquals(expected, actual, message = undefined) {}
  37. function assertGE(lhs, rhs) {}
  38. function assertNotEquals(lhs, rhs) {}
  39. function assertDeepEquals(lhs, rhs) {}