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

Side by Side Diff: ui/views/animation/ink_drop_impl_unittest.cc

Issue 2431493002: MD Buttons: Don't add layers for hidden -> hidden transitions. (Closed)
Patch Set: Additional test Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « ui/views/animation/ink_drop_impl.cc ('k') | ui/views/animation/test/test_ink_drop_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/animation/ink_drop_impl.h" 5 #include "ui/views/animation/ink_drop_impl.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/test/test_simple_task_runner.h" 8 #include "base/test/test_simple_task_runner.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 test_api_.CompleteAnimations(); 363 test_api_.CompleteAnimations();
364 EXPECT_EQ(0, ink_drop_host_.num_ink_drop_layers()); 364 EXPECT_EQ(0, ink_drop_host_.num_ink_drop_layers());
365 365
366 ink_drop_.SnapToActivated(); 366 ink_drop_.SnapToActivated();
367 EXPECT_EQ(1, ink_drop_host_.num_ink_drop_layers()); 367 EXPECT_EQ(1, ink_drop_host_.num_ink_drop_layers());
368 ink_drop_.SetHovered(true); 368 ink_drop_.SetHovered(true);
369 EXPECT_EQ(1, ink_drop_host_.num_ink_drop_layers()); 369 EXPECT_EQ(1, ink_drop_host_.num_ink_drop_layers());
370 EXPECT_TRUE(test_api_.IsHighlightFadingInOrVisible()); 370 EXPECT_TRUE(test_api_.IsHighlightFadingInOrVisible());
371 } 371 }
372 372
373 // Test that (re-)hiding or un-hovering a hidden ink drop doesn't add layers.
374 TEST_F(InkDropImplTest, AlwaysHiddenInkDropHasNoLayers) {
375 ink_drop_host_.set_should_show_highlight(true);
376
377 EXPECT_EQ(0, ink_drop_host_.num_ink_drop_layers_added());
378
379 ink_drop_.AnimateToState(InkDropState::HIDDEN);
380 EXPECT_EQ(0, ink_drop_host_.num_ink_drop_layers_added());
381
382 ink_drop_.SetHovered(false);
383 EXPECT_EQ(0, ink_drop_host_.num_ink_drop_layers_added());
384 }
385
373 } // namespace views 386 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_impl.cc ('k') | ui/views/animation/test/test_ink_drop_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698