-
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.
[responsive toolbar] force all buttons not overflow in browser tests
Add a flag to make sure responsive toolbar would not overflow buttons and turn it it on browser tests by default. This prevents responsive toolbar from accidentally breaking browser tests. For responsive toolbar specific tests we need to revert the flag to test responsive toolbar specific logic. Bug: 1463774 Change-Id: Ief7f968de29adddbe1dd7d8ef1859d263f6676c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4937130 Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Dana Fried <dfried@chromium.org> Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com> Commit-Queue: Yuheng Huang <yuhengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#1213091}
- Loading branch information
Yuheng Huang
authored and
Chromium LUCI CQ
committed
Oct 21, 2023
1 parent
932998e
commit 1188e6b
Showing
6 changed files
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// 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/toolbar_controller_util.h" | ||
|
||
bool ToolbarControllerUtil::prevent_overflow_for_testing_ = false; | ||
|
||
// static | ||
void ToolbarControllerUtil::SetPreventOverflowForTesting( | ||
bool prevent_overflow) { | ||
prevent_overflow_for_testing_ = prevent_overflow; | ||
} | ||
|
||
// static | ||
bool ToolbarControllerUtil::PreventOverflow() { | ||
return prevent_overflow_for_testing_; | ||
} |
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,19 @@ | ||
// 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. | ||
|
||
#ifndef CHROME_BROWSER_UI_TOOLBAR_CONTROLLER_UTIL_H_ | ||
#define CHROME_BROWSER_UI_TOOLBAR_CONTROLLER_UTIL_H_ | ||
class ToolbarControllerUtil { | ||
public: | ||
// Set whether prevent toolbar buttons from overflow. Should only call by | ||
// tests. | ||
static void SetPreventOverflowForTesting(bool prevent_overflow); | ||
|
||
// Return whether should prevent toolbar buttons from overflow. | ||
static bool PreventOverflow(); | ||
|
||
private: | ||
static bool prevent_overflow_for_testing_; | ||
}; | ||
#endif // CHROME_BROWSER_UI_TOOLBAR_CONTROLLER_UTIL_H_ |
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