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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 2688353005: Fix shelf alignment and auto-hide initialization. (Closed)
Patch Set: Fix mash_unittests by installing a TestShellDelegate. Created 3 years, 10 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: ash/shelf/shelf_view_unittest.cc
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index 04aff136026446704bdceb6ef40e3a9b7771fe1a..36fec559d4ac3a9d886b61a4a1503d6553e72b84 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -243,7 +243,7 @@ TEST_F(WmShelfObserverIconTest, BoundsChanged) {
// A ShelfDelegate test double that will always convert between ShelfIDs and app
// ids. This does not support pinning and unpinning operations and the return
// value of IsAppPinned(...) is configurable.
-class TestShelfDelegateForShelfView : public ShelfDelegate {
+class TestShelfDelegateForShelfView : public TestShelfDelegate {
public:
TestShelfDelegateForShelfView() {}
~TestShelfDelegateForShelfView() override {}
@@ -257,11 +257,6 @@ class TestShelfDelegateForShelfView : public ShelfDelegate {
return id;
}
- ShelfID GetShelfIDForAppIDAndLaunchID(const std::string& app_id,
- const std::string& launch_id) override {
- return GetShelfIDForAppID(app_id);
- }
-
bool HasShelfIDToAppIDMapping(ShelfID id) const override { return true; }
const std::string& GetAppIDForShelfID(ShelfID id) override {
@@ -684,6 +679,8 @@ class ShelfViewTest : public AshTestBase {
}
void ReplaceShelfDelegate() {
+ // Clear the value first to avoid TestShelfDelegate's singleton check.
+ WmShell::Get()->SetShelfDelegateForTesting(nullptr);
shelf_delegate_ = new TestShelfDelegateForShelfView();
test_api_->SetShelfDelegate(shelf_delegate_);
WmShell::Get()->SetShelfDelegateForTesting(
@@ -737,10 +734,6 @@ class ShelfViewTextDirectionTest : public ShelfViewTest,
ShelfViewTextDirectionTest() : text_direction_change_(GetParam()) {}
virtual ~ShelfViewTextDirectionTest() {}
- void SetUp() override { ShelfViewTest::SetUp(); }
-
- void TearDown() override { ShelfViewTest::TearDown(); }
-
private:
ScopedTextDirectionChange text_direction_change_;

Powered by Google App Engine
This is Rietveld 408576698