From 9aae174a154c62eb3e219074dc04f9fd1947729d Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Mon, 29 Jul 2019 17:24:23 -0700 Subject: [PATCH] AMC features should default to true in desktop It is expected that in mobile mode, onRequestContextCreateSkinMobile hook will explicitly set skin options based on the user configuration. The desktop should however reflect everything with AMC enabled. Bug: T229295 Change-Id: Ib3bf09c25d9bcf9b31d994b92a1d016cca8a6224 --- includes/SkinOptions.php | 10 +++++++--- tests/phpunit/skins/SkinMinervaTest.php | 3 +++ tests/phpunit/unit/SkinOptionsTest.php | 3 +++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/includes/SkinOptions.php b/includes/SkinOptions.php index bcbb45fcf..55fa049b1 100644 --- a/includes/SkinOptions.php +++ b/includes/SkinOptions.php @@ -55,10 +55,14 @@ final class SkinOptions { self::SHARE_BUTTON => false, /** Whether sections can be collapsed (requires MobileFrontend and MobileFormatter) */ self::TOGGLING => false, + /** requires a wiki using Template:Ambox */ self::PAGE_ISSUES => false, - self::TALK_AT_TOP => false, - self::HISTORY_IN_PAGE_ACTIONS => false, - self::TOOLBAR_SUBMENU => false, + /** no extension requirements */ + self::TALK_AT_TOP => true, + /** no extension requirements */ + self::HISTORY_IN_PAGE_ACTIONS => true, + /** no extension requirements */ + self::TOOLBAR_SUBMENU => true, /** Whether to show tabs on special pages */ self::TABS_ON_SPECIALS => false, ]; diff --git a/tests/phpunit/skins/SkinMinervaTest.php b/tests/phpunit/skins/SkinMinervaTest.php index 19f4d6c08..ba88cb8cd 100644 --- a/tests/phpunit/skins/SkinMinervaTest.php +++ b/tests/phpunit/skins/SkinMinervaTest.php @@ -144,6 +144,9 @@ class SkinMinervaTest extends MediaWikiTestCase { public function testGetContextSpecificModules( $backToTopValue, $moduleName, $expected ) { $this->overrideSkinOptions( [ SkinOptions::AMC_MODE => false, + SkinOptions::TALK_AT_TOP => false, + SkinOptions::HISTORY_IN_PAGE_ACTIONS => false, + SkinOptions::TOOLBAR_SUBMENU => false, 'backToTop' => $backToTopValue, ] ); diff --git a/tests/phpunit/unit/SkinOptionsTest.php b/tests/phpunit/unit/SkinOptionsTest.php index 50d00f31d..62f07ea4e 100644 --- a/tests/phpunit/unit/SkinOptionsTest.php +++ b/tests/phpunit/unit/SkinOptionsTest.php @@ -41,6 +41,9 @@ class SkinOptionsTest extends \MediaWikiUnitTestCase { $options->setMultiple( [ SkinOptions::BACK_TO_TOP => true ] ); $this->assertTrue( $options->hasSkinOptions() ); $options->setMultiple( [ + SkinOptions::TALK_AT_TOP => false, + SkinOptions::HISTORY_IN_PAGE_ACTIONS => false, + SkinOptions::TOOLBAR_SUBMENU => false, SkinOptions::AMC_MODE => false, SkinOptions::BACK_TO_TOP => false ] );