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

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc

Issue 1456213002: Revert of [Extensions] Don't count bubble dismissal from focus loss as acknowledgment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.h" 5 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 CreateAndAddExtension("extension", 417 CreateAndAddExtension("extension",
418 extensions::extension_action_test_util::NO_ACTION); 418 extensions::extension_action_test_util::NO_ACTION);
419 EXPECT_TRUE(ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile( 419 EXPECT_TRUE(ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile(
420 profile())); 420 profile()));
421 421
422 // If the bubble was recently shown, we shouldn't show it again... 422 // If the bubble was recently shown, we shouldn't show it again...
423 scoped_ptr<ToolbarActionsBarBubbleDelegate> bubble_delegate( 423 scoped_ptr<ToolbarActionsBarBubbleDelegate> bubble_delegate(
424 new ExtensionToolbarIconSurfacingBubbleDelegate(profile())); 424 new ExtensionToolbarIconSurfacingBubbleDelegate(profile()));
425 bubble_delegate->OnBubbleShown(); 425 bubble_delegate->OnBubbleShown();
426 bubble_delegate->OnBubbleClosed( 426 bubble_delegate->OnBubbleClosed(
427 ToolbarActionsBarBubbleDelegate::CLOSE_DISMISS_USER_ACTION); 427 ToolbarActionsBarBubbleDelegate::CLOSE_DISMISS);
428 EXPECT_FALSE( 428 EXPECT_FALSE(
429 ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile( 429 ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile(
430 profile())); 430 profile()));
431 431
432 // ...But if it was only dismissed, we should show it before too long. 432 // ...But if it was only dismissed, we should show it before too long.
433 base::Time two_days_ago = base::Time::Now() - base::TimeDelta::FromDays(2); 433 base::Time two_days_ago = base::Time::Now() - base::TimeDelta::FromDays(2);
434 prefs->SetInt64(prefs::kToolbarIconSurfacingBubbleLastShowTime, 434 prefs->SetInt64(prefs::kToolbarIconSurfacingBubbleLastShowTime,
435 two_days_ago.ToInternalValue()); 435 two_days_ago.ToInternalValue());
436 EXPECT_TRUE(ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile( 436 EXPECT_TRUE(ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile(
437 profile())); 437 profile()));
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 // Set the width back to the preferred width. All should be back to normal. 558 // Set the width back to the preferred width. All should be back to normal.
559 browser_action_test_util()->SetWidth( 559 browser_action_test_util()->SetWidth(
560 toolbar_actions_bar()->GetPreferredSize().width()); 560 toolbar_actions_bar()->GetPreferredSize().width());
561 EXPECT_EQ(3u, toolbar_actions_bar()->GetIconCount()); 561 EXPECT_EQ(3u, toolbar_actions_bar()->GetIconCount());
562 EXPECT_EQ(0u, toolbar_actions_bar()->GetStartIndexInBounds()); 562 EXPECT_EQ(0u, toolbar_actions_bar()->GetStartIndexInBounds());
563 EXPECT_EQ(3u, toolbar_actions_bar()->GetEndIndexInBounds()); 563 EXPECT_EQ(3u, toolbar_actions_bar()->GetEndIndexInBounds());
564 EXPECT_EQ(3u, overflow_bar()->GetStartIndexInBounds()); 564 EXPECT_EQ(3u, overflow_bar()->GetStartIndexInBounds());
565 EXPECT_EQ(3u, overflow_bar()->GetEndIndexInBounds()); 565 EXPECT_EQ(3u, overflow_bar()->GetEndIndexInBounds());
566 EXPECT_FALSE(toolbar_actions_bar()->NeedsOverflow()); 566 EXPECT_FALSE(toolbar_actions_bar()->NeedsOverflow());
567 } 567 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698