Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "Reland "Reland "[CSC] Create chrome flags for Companion UXR."""
This reverts commit 0329f0e. Reason for revert: Fixing build issue to re-merge Original change's description: > Revert "Reland "Reland "[CSC] Create chrome flags for Companion UXR.""" > > This reverts commit d20d1b3. > > Reason for revert: This has a build issue: > > https://bugs.chromium.org/p/chromium/issues/detail?id=1451939 > > > Original change's description: > > Reland "Reland "[CSC] Create chrome flags for Companion UXR."" > > > > This reverts commit f91001b. > > > > Reason for revert: Re-land to fix the enums and histogram checks. > > > > Original change's description: > > > Revert "Reland "[CSC] Create chrome flags for Companion UXR."" > > > > > > This reverts commit 86f8ba8. > > > > > > Reason for revert: Tests still failing for feature: > > > https://ci.chromium.org/ui/p/chrome/builders/ci/linux-chromeos-chrome/33141/test-results?sortby=&groupby= > > > > > > Bug: 1449587 > > > > > > Original change's description: > > > > Reland "[CSC] Create chrome flags for Companion UXR." > > > > > > > > This reverts commit d90aaa6. > > > > > > > > Reason for revert: Fixing the enums generation issue. > > > > > > > > Original change's description: > > > > > Revert "[CSC] Create chrome flags for Companion UXR." > > > > > > > > > > This reverts commit 8b1641f. > > > > > > > > > > Reason for revert: Failing AboutFlagsHistogram on linux-chromeos-chrome. > > > > > https://ci.chromium.org/ui/p/chrome/builders/ci/linux-chromeos-chrome/33089/overview > > > > > PTAL: https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md#flag-histograms > > > > > > > > > > Original change's description: > > > > > > [CSC] Create chrome flags for Companion UXR. > > > > > > > > > > > > This requires us to be able to explicitly control the clobber vs new > > > > > > tab behavior. We also need to be able to control the pin AND ignore > > > > > > the labs experiment state (e.g., when unpinned and labs is on, > > > > > > the UI will attempt to force the state to pinned, this overrides > > > > > > that behavior). > > > > > > > > > > > > Bug: b:283109243 > > > > > > Change-Id: I981ad573ee38cb4b69bb39f008c134c4e14bbf56 > > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4553173 > > > > > > Reviewed-by: Caroline Rising <corising@chromium.org> > > > > > > Commit-Queue: Michael Crouse <mcrouse@chromium.org> > > > > > > Reviewed-by: Tarun Bansal <tbansal@chromium.org> > > > > > > Cr-Commit-Position: refs/heads/main@{#1148554} > > > > > > > > > > Bug: b:283109243 > > > > > Change-Id: Ic0fcdcc8512a5e38ffbaef7b5492c766b1961294 > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4564057 > > > > > Owners-Override: Ana Salazar Maldonado <anasalazar@google.com> > > > > > Reviewed-by: Ana Salazar Maldonado <anasalazar@google.com> > > > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Auto-Submit: Ana Salazar Maldonado <anasalazar@google.com> > > > > > Cr-Commit-Position: refs/heads/main@{#1148779} > > > > > > > > Bug: b:283109243 > > > > Change-Id: I1785c9de3aee67a87a19ce51cc8591fa99f7f40a > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4569767 > > > > Reviewed-by: Tarun Bansal <tbansal@chromium.org> > > > > Commit-Queue: Michael Crouse <mcrouse@chromium.org> > > > > Cr-Commit-Position: refs/heads/main@{#1149978} > > > > > > Bug: b:283109243 > > > Change-Id: I43be3f4a73c604e601d40bcf7a16745e2cc04f79 > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4571762 > > > Owners-Override: Ana Salazar Maldonado <anasalazar@google.com> > > > Auto-Submit: Ana Salazar Maldonado <anasalazar@google.com> > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Cr-Commit-Position: refs/heads/main@{#1150204} > > > > (cherry picked from commit ff4a6cf) > > > > Bug: 1449587 > > Bug: b:283109243 > > Change-Id: I60082380b29022de4ca58417020c74a695b00772 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4567442 > > Commit-Queue: Michael Crouse <mcrouse@chromium.org> > > Reviewed-by: Tarun Bansal <tbansal@chromium.org> > > Auto-Submit: Michael Crouse <mcrouse@chromium.org> > > Cr-Original-Commit-Position: refs/heads/main@{#1151070} > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4590411 > > Cr-Commit-Position: refs/branch-heads/5790@{#375} > > Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114} > > Bug: 1449587 > Bug: b:283109243 > Change-Id: I37b42be8de8378c2ee1db10a484127ccddae2c9c > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4593981 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Michael Crouse <mcrouse@chromium.org> > Cr-Commit-Position: refs/branch-heads/5790@{#430} > Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114} Bug: 1449587 Bug: b:283109243 Change-Id: I6dd486a216dd1e2bab4d252b15c4aac42347fd27 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4608392 Commit-Queue: Michael Crouse <mcrouse@chromium.org> Reviewed-by: Tarun Bansal <tbansal@chromium.org> Commit-Queue: Tarun Bansal <tbansal@chromium.org> Auto-Submit: Michael Crouse <mcrouse@chromium.org> Cr-Commit-Position: refs/branch-heads/5790@{#695} Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
- Loading branch information
Michael Crouse
authored and
Chromium LUCI CQ
committed
Jun 13, 2023
1 parent
89e7cbf
commit e8b4739
Showing
11 changed files
with
174 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
96 changes: 96 additions & 0 deletions
96
chrome/browser/ui/side_panel/companion/companion_utils_unittest.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,96 @@ | ||
// 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 "chrome/browser/ui/side_panel/companion/companion_utils.h" | ||
|
||
#include "base/command_line.h" | ||
#include "base/feature_list.h" | ||
#include "base/test/scoped_feature_list.h" | ||
#include "chrome/browser/companion/core/constants.h" | ||
#include "chrome/browser/companion/core/features.h" | ||
#include "chrome/browser/ui/ui_features.h" | ||
#include "chrome/common/pref_names.h" | ||
#include "components/prefs/pref_registry_simple.h" | ||
#include "components/prefs/testing_pref_service.h" | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
|
||
namespace companion { | ||
|
||
void RegisterPrefs(TestingPrefServiceSimple* pref_service) { | ||
pref_service->registry()->RegisterBooleanPref( | ||
prefs::kSidePanelCompanionEntryPinnedToToolbar, false); | ||
pref_service->registry()->RegisterBooleanPref( | ||
companion::kExpsOptInStatusGrantedPref, false); | ||
} | ||
|
||
TEST(CompanionUtilsTest, PinnedStateCommandlineOverridePinned) { | ||
TestingPrefServiceSimple pref_service; | ||
RegisterPrefs(&pref_service); | ||
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | ||
switches::kForceCompanionPinnedState, "pinned"); | ||
|
||
UpdateCompanionDefaultPinnedToToolbarState(&pref_service); | ||
EXPECT_EQ( | ||
pref_service.GetBoolean(prefs::kSidePanelCompanionEntryPinnedToToolbar), | ||
true); | ||
} | ||
|
||
TEST(CompanionUtilsTest, PinnedStateCommandlineOverrideUnpinned) { | ||
TestingPrefServiceSimple pref_service; | ||
RegisterPrefs(&pref_service); | ||
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | ||
switches::kForceCompanionPinnedState, "unpinned"); | ||
|
||
UpdateCompanionDefaultPinnedToToolbarState(&pref_service); | ||
EXPECT_EQ( | ||
pref_service.GetBoolean(prefs::kSidePanelCompanionEntryPinnedToToolbar), | ||
false); | ||
} | ||
|
||
TEST(CompanionUtilsTest, UpdatePinnedStateDefaultUnpinnedLabsOverride) { | ||
base::test::ScopedFeatureList scoped_feature_list; | ||
TestingPrefServiceSimple pref_service; | ||
RegisterPrefs(&pref_service); | ||
|
||
scoped_feature_list.InitAndDisableFeature( | ||
::features::kSidePanelCompanionDefaultPinned); | ||
pref_service.SetBoolean(companion::kExpsOptInStatusGrantedPref, true); | ||
|
||
UpdateCompanionDefaultPinnedToToolbarState(&pref_service); | ||
EXPECT_EQ( | ||
pref_service.GetBoolean(prefs::kSidePanelCompanionEntryPinnedToToolbar), | ||
true); | ||
} | ||
|
||
TEST(CompanionUtilsTest, UpdatePinnedStateDefaultPinned) { | ||
base::test::ScopedFeatureList scoped_feature_list; | ||
TestingPrefServiceSimple pref_service; | ||
RegisterPrefs(&pref_service); | ||
|
||
scoped_feature_list.InitAndEnableFeature( | ||
::features::kSidePanelCompanionDefaultPinned); | ||
pref_service.SetBoolean(companion::kExpsOptInStatusGrantedPref, false); | ||
|
||
UpdateCompanionDefaultPinnedToToolbarState(&pref_service); | ||
EXPECT_EQ( | ||
pref_service.GetBoolean(prefs::kSidePanelCompanionEntryPinnedToToolbar), | ||
true); | ||
} | ||
|
||
TEST(CompanionUtilsTest, UpdatePinnedStateDefaultUnPinned) { | ||
base::test::ScopedFeatureList scoped_feature_list; | ||
TestingPrefServiceSimple pref_service; | ||
RegisterPrefs(&pref_service); | ||
|
||
scoped_feature_list.InitAndDisableFeature( | ||
::features::kSidePanelCompanionDefaultPinned); | ||
pref_service.SetBoolean(companion::kExpsOptInStatusGrantedPref, false); | ||
|
||
UpdateCompanionDefaultPinnedToToolbarState(&pref_service); | ||
EXPECT_EQ( | ||
pref_service.GetBoolean(prefs::kSidePanelCompanionEntryPinnedToToolbar), | ||
false); | ||
} | ||
|
||
} // namespace companion |
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