blob: 109ab8f65cd66cde8033d34a34735b77b1e4d485 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Tabs get Test</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
<script type="text/javascript" src="head.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script type="text/javascript">
"use strict";
add_task(async function() {
const extension = ExtensionTestUtils.loadExtension({
async background() {
const tab1 = await browser.tabs.create({});
const tab2 = await browser.tabs.create({});
browser.test.assertEq(tab1.id, (await browser.tabs.get(tab1.id)).id, "tabs.get should return tab with given id");
browser.test.assertEq(tab2.id, (await browser.tabs.get(tab2.id)).id, "tabs.get should return tab with given id");
await browser.tabs.remove(tab1.id);
await browser.tabs.remove(tab2.id);
browser.test.notifyPass("tabs.get");
},
});
await extension.startup();
await extension.awaitFinish("tabs.get");
await extension.unload();
});
</script>
</body>
</html>
|