-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tab Organization: Show WebUI on chip click
Bug: 1469126 Change-Id: I35ff70b9fea5e4aca2628cfbd10f41f8c03451d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4944208 Commit-Queue: Emily Shack <emshack@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Charles Meng <charlesmeng@chromium.org> Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#1211238}
- Loading branch information
Emily Shack
authored and
Chromium LUCI CQ
committed
Oct 18, 2023
1 parent
12e10e4
commit 2b3f388
Showing
16 changed files
with
121 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; | ||
import {TabSearchApiProxyImpl, TabSearchAppElement} from 'chrome://tab-search.top-chrome/tab_search.js'; | ||
import {assertEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; | ||
import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; | ||
|
||
import {TestTabSearchApiProxy} from './test_tab_search_api_proxy.js'; | ||
|
||
suite('TabOrganizationPageTest', () => { | ||
let tabSearchApp: TabSearchAppElement; | ||
let testProxy: TestTabSearchApiProxy; | ||
|
||
setup(async () => { | ||
testProxy = new TestTabSearchApiProxy(); | ||
TabSearchApiProxyImpl.setInstance(testProxy); | ||
|
||
loadTimeData.overrideValues({ | ||
tabOrganizationEnabled: true, | ||
}); | ||
|
||
tabSearchApp = document.createElement('tab-search-app'); | ||
|
||
document.body.innerHTML = window.trustedTypes!.emptyHTML; | ||
document.body.appendChild(tabSearchApp); | ||
await flushTasks(); | ||
}); | ||
|
||
test('Switching tabs calls setTabIndex', async () => { | ||
assertEquals(0, testProxy.getCallCount('setTabIndex')); | ||
|
||
const crTabs = tabSearchApp.shadowRoot!.querySelector('cr-tabs'); | ||
assertTrue(!!crTabs); | ||
assertEquals(0, crTabs.selected); | ||
|
||
const allTabs = crTabs.shadowRoot!.querySelectorAll<HTMLElement>('.tab'); | ||
assertEquals(2, allTabs.length); | ||
const newTabIndex = 1; | ||
const unselectedTab = allTabs[newTabIndex]!; | ||
unselectedTab.click(); | ||
|
||
const [tabIndex] = await testProxy.whenCalled('setTabIndex'); | ||
assertEquals(newTabIndex, tabIndex); | ||
assertEquals(newTabIndex, crTabs.selected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters