Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7550)

Unified Diff: chrome/test/data/webui/settings/languages_page_browsertest.js

Issue 2663083002: MD Settings: Migrate enable-translation toggle from non-MD settings page. (Closed)
Patch Set: remove top border; indent code Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/settings/languages_page_browsertest.js
diff --git a/chrome/test/data/webui/settings/languages_page_browsertest.js b/chrome/test/data/webui/settings/languages_page_browsertest.js
index a7e1dd9673e32a6dc906821bab903fb4cb14851c..0363c1738cc2452ea211a51406a5814eb488bbdd 100644
--- a/chrome/test/data/webui/settings/languages_page_browsertest.js
+++ b/chrome/test/data/webui/settings/languages_page_browsertest.js
@@ -235,6 +235,14 @@ TEST_F('SettingsLanguagesPageBrowserTest', 'MAYBE_LanguagesPage', function() {
cr.isChromeOS || cr.isWindows ? 1 : 0, separator.offsetHeight);
});
+ test('test enable translation toggle', function() {
+ var toggle = languagesPage.$.offerTranslateOtherLangs;
michaelpg 2017/01/31 21:54:10 this assumes translate is already enabled. we shou
scottchen 2017/02/01 01:02:39 The button that this line is grabbing is the toggl
michaelpg 2017/02/01 01:50:02 origTranslateEnabled is used to ensure the value g
scottchen 2017/02/01 02:04:31 The test would be valid regardless of origTranslat
michaelpg 2017/02/01 02:57:15 I was playing with this test to try to show what I
scottchen 2017/02/01 18:52:35 Acknowledged. Please see newest patch.
+ assertTrue(!!toggle);
+ MockInteractions.tap(toggle);
+ var newTranslateEnabled = languageHelper.prefs.translate.enabled.value;
+ assertEquals(!origTranslateEnabled, newTranslateEnabled);
michaelpg 2017/01/31 21:54:10 can you also test that disabling the toggle button
scottchen 2017/02/01 01:02:38 Do you mean disabling the toggle button as in <set
michaelpg 2017/02/01 01:50:02 Sorry, yes, if we "uncheck" the toggle button to t
+ });
+
test('toggle translate', function(done) {
michaelpg 2017/01/31 21:54:10 change title to something like 'toggle translate f
scottchen 2017/02/01 01:02:39 Done.
// Enable Translate so the menu always shows the Translate checkbox.
languageHelper.setPrefValue('translate.enabled', true);

Powered by Google App Engine
This is Rietveld 408576698