Commit 539b849c authored by Ioana Pandele's avatar Ioana Pandele Committed by Commit Bot

[ReEPwdSave] Display the toggle above the "No saved passwords..." message

Bug: 1044930
Change-Id: Iabfaa5603aa6de5007a66fa53a3d01cd9df8436c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2166172Reviewed-by: default avatarFriedrich [CET] <fhorschig@chromium.org>
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763386}
parent b61bc6d1
......@@ -62,12 +62,12 @@ class AccessorySheetTabMediator implements Provider.Observer<AccessorySheetData>
if (accessorySheetData == null) return new AccessorySheetDataPiece[0];
List<AccessorySheetDataPiece> items = new ArrayList<>();
if (shouldShowTitle(accessorySheetData.getUserInfoList())) {
items.add(new AccessorySheetDataPiece(accessorySheetData.getTitle(), Type.TITLE));
}
if (accessorySheetData.getOptionToggle() != null) {
items.add(createDataPieceForToggle(accessorySheetData.getOptionToggle()));
}
if (shouldShowTitle(accessorySheetData.getUserInfoList())) {
items.add(new AccessorySheetDataPiece(accessorySheetData.getTitle(), Type.TITLE));
}
if (!accessorySheetData.getWarning().isEmpty()) {
items.add(new AccessorySheetDataPiece(accessorySheetData.getWarning(), Type.WARNING));
}
......
......@@ -208,7 +208,7 @@ public class PasswordAccessorySheetControllerTest {
// Invoke callback on the option toggle that was stored in the model. This is not the same
// as the OptionToggle passed above, because the mediator repackages it to include an
// additional method call in the callback.
OptionToggle repackagedToggle = (OptionToggle) mSheetDataPieces.get(1).getDataPiece();
OptionToggle repackagedToggle = (OptionToggle) mSheetDataPieces.get(0).getDataPiece();
// Pretend to enable the toggle like a click would do.
repackagedToggle.getCallback().onResult(true);
......@@ -216,7 +216,7 @@ public class PasswordAccessorySheetControllerTest {
// Check that the original callback was called and that the model was updated with an
// enabled toggle
assertTrue(toggleEnabled.get());
assertTrue(((OptionToggle) mSheetDataPieces.get(1).getDataPiece()).isEnabled());
assertTrue(((OptionToggle) mSheetDataPieces.get(0).getDataPiece()).isEnabled());
}
@Test
......
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