Commit 29d39531 authored by James Cook's avatar James Cook Committed by Commit Bot

Change SingleProcessMash shelf indicator from "-" to "SPM"

The dash looks like a negative time value. "SPM" is easily found in
code search.

Tweaks the expectations for some fragile shelf view tests that depend
on the exact width of the shelf. I changed the values so the tests will
fail when the "SPM" indicator is removed, to ensure that I clean up
the tests.

Bug: none
Change-Id: Id751760b2786730c479db09ad18e1e6e841119b0
Reviewed-on: https://chromium-review.googlesource.com/c/1466026Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631943}
parent e212e1a7
......@@ -771,7 +771,11 @@ TEST_F(ShelfViewTest, OverflowVisibleIndex) {
// Adding another shortcut should go into overflow bubble and not change
// shelf index.
EXPECT_EQ(last_visible_index, test_api_->GetLastVisibleIndex());
// TODO(crbug.com/918537): Remove when "SPM" indicator is removed.
if (::features::IsSingleProcessMash())
EXPECT_EQ(last_visible_index, test_api_->GetLastVisibleIndex() - 1);
else
EXPECT_EQ(last_visible_index, test_api_->GetLastVisibleIndex());
}
// Adds one platform app button then adds app shortcut until overflow. Verifies
......@@ -1248,7 +1252,11 @@ TEST_F(ShelfViewTest, ShelfRipOff) {
generator->set_current_screen_location(overflow_app_location);
generator->PressLeftButton();
generator->MoveMouseTo(second_app_location);
EXPECT_TRUE(test_api_for_overflow.IsRippedOffFromShelf());
// TODO(crbug.com/918537): Remove when "SPM" indicator is removed.
if (::features::IsSingleProcessMash())
EXPECT_FALSE(test_api_for_overflow.IsRippedOffFromShelf());
else
EXPECT_TRUE(test_api_for_overflow.IsRippedOffFromShelf());
generator->MoveMouseTo(overflow_app_location);
generator->ReleaseLeftButton();
EXPECT_FALSE(test_api_for_overflow.IsRippedOffFromShelf());
......@@ -3563,7 +3571,11 @@ TEST_F(ShelfViewOverflowFocusTest, Basic) {
EXPECT_TRUE(test_api_->IsOverflowButtonVisible());
EXPECT_FALSE(test_api_->IsShowingOverflowBubble());
EXPECT_EQ(last_item_on_main_shelf_index_, items_ - 5);
// TODO(crbug.com/918537): Put back when "SPM" indicator is removed.
if (::features::IsSingleProcessMash())
EXPECT_EQ(last_item_on_main_shelf_index_, items_ - 4);
else
EXPECT_EQ(last_item_on_main_shelf_index_, items_ - 5);
EXPECT_TRUE(shelf_view_->shelf_widget()->IsActive());
EXPECT_TRUE(test_api_->GetViewAt(1)->HasFocus());
}
......@@ -3628,8 +3640,8 @@ TEST_F(ShelfViewOverflowFocusTest, ForwardCyclingWithBubbleOpen) {
->bubble_view()
->GetWidget()
->GetFocusManager()
->SetFocusedView(
overflow_shelf_test_api_->GetViewAt(first_index_overflow_shelf + 3));
->SetFocusedView(overflow_shelf_test_api_->GetViewAt(
overflow_shelf_test_api_->GetLastVisibleIndex()));
// Tests that after pressing tab once more, the main shelf widget now is
// active, and the first item on the main shelf has focus.
......@@ -3649,9 +3661,9 @@ TEST_F(ShelfViewOverflowFocusTest, BackwardCyclingWithBubbleOpen) {
EXPECT_TRUE(
test_api_->overflow_bubble()->bubble_view()->GetWidget()->IsActive());
const int first_index_overflow_shelf = last_item_on_main_shelf_index_ + 1;
EXPECT_TRUE(
overflow_shelf_test_api_->GetViewAt(first_index_overflow_shelf + 3)
->HasFocus());
EXPECT_TRUE(overflow_shelf_test_api_
->GetViewAt(overflow_shelf_test_api_->GetLastVisibleIndex())
->HasFocus());
// Focus the first item on the overflow shelf.
test_api_->overflow_bubble()
......
......@@ -180,15 +180,14 @@ void TimeView::UpdateTextInternal(const base::Time& now) {
NotifyAccessibilityEvent(ax::mojom::Event::kTextChanged, true);
base::string16 current_time;
// Add a subtle indicator for SingleProcessMash that shows up in screenshots.
// TODO(crbug.com/918537): Remove before M-74 branch.
if (::features::IsSingleProcessMash()) {
current_time = base::ASCIIToUTF16("- ");
}
current_time += base::TimeFormatTimeOfDayWithHourClockType(
base::string16 current_time = base::TimeFormatTimeOfDayWithHourClockType(
now, model_->hour_clock_type(), base::kDropAmPm);
horizontal_label_->SetText(current_time);
base::string16 time_text = current_time;
// Add an indicator for SingleProcessMash that shows up in screenshots.
// TODO(crbug.com/918537): Remove before M-74 branch.
if (::features::IsSingleProcessMash())
time_text += base::UTF8ToUTF16(" SPM");
horizontal_label_->SetText(time_text);
horizontal_label_->SetTooltipText(base::TimeFormatFriendlyDate(now));
horizontal_label_->NotifyAccessibilityEvent(ax::mojom::Event::kTextChanged,
true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment