UNPKG

2.47 kBSource Map (JSON)View Raw
1{"version":3,"file":"browser_util_test.js","sourceRoot":"","sources":["../src/browser_util_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,QAAQ,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAE3D,iBAAiB,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;QAC3B,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC;QACrB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,qEAAqE;QACrE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,IAAI,IAAI,GAAG,KAAK,CAAC;QACjB,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,GAAG,IAAI,CAAC;QACd,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE;YACzC,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC;SACtB;QACD,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as tf from './index';\nimport {ALL_ENVS, describeWithFlags} from './jasmine_util';\n\ndescribeWithFlags('nextFrame', ALL_ENVS, () => {\n it('basic usage', async () => {\n const t0 = tf.util.now();\n await tf.nextFrame();\n const t1 = tf.util.now();\n // tf.util.now should give sufficient accuracy on all supported envs.\n expect(t1 > t0);\n });\n\n it('does not block timers', async () => {\n let flag = false;\n setTimeout(() => {\n flag = true;\n }, 50);\n const t0 = tf.util.now();\n expect(flag).toBe(false);\n while (tf.util.now() - t0 < 1000 && !flag) {\n await tf.nextFrame();\n }\n expect(flag).toBe(true);\n });\n});\n"]}
\No newline at end of file