-
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.
[waffle]Enable submit button on choice click
Screen recording: https://drive.google.com/file/d/17zEK5l6-OqnP3GC76Z0zHxWAWDBaA0dE/view?usp=sharing Bug: b/280753754 Change-Id: I0c7d5b8b47c79f61f6ce3eadcb53d3b4ddc68600 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4793794 Commit-Queue: Jack Yammine <jyammine@google.com> Reviewed-by: Nicolas Dossou-Gbété <dgn@chromium.org> Cr-Commit-Position: refs/heads/main@{#1187300}
- Loading branch information
Jack Yammine
authored and
Chromium LUCI CQ
committed
Aug 23, 2023
1 parent
a48f916
commit 3cf798c
Showing
10 changed files
with
119 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 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("//components/signin/features.gni") | ||
import("../build_webui_tests.gni") | ||
|
||
assert(enable_search_engine_choice) | ||
|
||
build_webui_tests("build") { | ||
resource_path_prefix = "search_engine_choice" | ||
|
||
files = [ "search_engine_choice_test.ts" ] | ||
|
||
ts_path_mappings = | ||
[ "chrome://search-engine-choice/*|" + | ||
rebase_path( | ||
"$root_gen_dir/chrome/browser/resources/search_engine_choice/tsc/*", | ||
target_gen_dir) ] | ||
ts_deps = [ | ||
"//chrome/browser/resources/search_engine_choice:build_ts", | ||
"//ui/webui/resources/js:build_ts", | ||
] | ||
} |
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 @@ | ||
mixins: "//chrome/browser/search_engine_choice/COMMON_METADATA" |
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 @@ | ||
file://chrome/browser/search_engine_choice/OWNERS |
25 changes: 25 additions & 0 deletions
25
chrome/test/data/webui/search_engine_choice/search_engine_choice_js_browsertest.cc
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,25 @@ | ||
// 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. | ||
|
||
#include "base/test/scoped_feature_list.h" | ||
#include "chrome/common/webui_url_constants.h" | ||
#include "chrome/test/base/web_ui_mocha_browser_test.h" | ||
#include "components/signin/public/base/signin_switches.h" | ||
#include "content/public/test/browser_test.h" | ||
|
||
class SearchEngineChoiceJsBrowserTest : public WebUIMochaBrowserTest { | ||
protected: | ||
SearchEngineChoiceJsBrowserTest() { | ||
set_test_loader_host(chrome::kChromeUISearchEngineChoiceHost); | ||
} | ||
|
||
private: | ||
base::test::ScopedFeatureList scoped_feature_list_{ | ||
switches::kSearchEngineChoice}; | ||
}; | ||
|
||
IN_PROC_BROWSER_TEST_F(SearchEngineChoiceJsBrowserTest, | ||
SearchEngineChoiceTest) { | ||
RunTest("search_engine_choice/search_engine_choice_test.js", "mocha.run()"); | ||
} |
35 changes: 35 additions & 0 deletions
35
chrome/test/data/webui/search_engine_choice/search_engine_choice_test.ts
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,35 @@ | ||
// 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 'chrome://search-engine-choice/app.js'; | ||
|
||
import {SearchEngineChoiceAppElement} from 'chrome://search-engine-choice/app.js'; | ||
import {assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; | ||
import {waitBeforeNextRender} from 'chrome://webui-test/polymer_test_util.js'; | ||
|
||
suite('SearchEngineChoiceTest', function() { | ||
let testElement: SearchEngineChoiceAppElement; | ||
|
||
setup(function() { | ||
document.body.innerHTML = window.trustedTypes!.emptyHTML; | ||
testElement = document.createElement('search-engine-choice-app'); | ||
document.body.appendChild(testElement); | ||
return waitBeforeNextRender(testElement); | ||
}); | ||
|
||
teardown(function() { | ||
testElement.remove(); | ||
}); | ||
|
||
test('Submit button enabled on choice click', function() { | ||
assertTrue(testElement.$.submitButton.disabled); | ||
|
||
const radioButtons = | ||
testElement.shadowRoot!.querySelectorAll('cr-radio-button'); | ||
|
||
assertTrue(radioButtons.length > 0); | ||
radioButtons[0]!.click(); | ||
assertFalse(testElement.$.submitButton.disabled); | ||
}); | ||
}); |