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

Unified Diff: chrome/browser/ui/ash/shelf_browsertest.cc

Issue 2741343018: cros: test coverage of shelf alignment initialization for guest session (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/shelf_browsertest.cc
diff --git a/chrome/browser/ui/ash/shelf_browsertest.cc b/chrome/browser/ui/ash/shelf_browsertest.cc
index f39d951ffce9ccee6833d4c8918dedb85e257cb1..3d69aaa9c67cc16f66bfc1babea6c20035559e6f 100644
--- a/chrome/browser/ui/ash/shelf_browsertest.cc
+++ b/chrome/browser/ui/ash/shelf_browsertest.cc
@@ -5,13 +5,17 @@
#include "ash/common/shelf/shelf_layout_manager.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm_window.h"
+#include "base/command_line.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/status_bubble.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "chromeos/chromeos_switches.h"
+#include "components/user_manager/user_names.h"
-typedef InProcessBrowserTest ShelfBrowserTest;
+using ShelfBrowserTest = InProcessBrowserTest;
// Confirm that a status bubble doesn't cause the shelf to darken.
IN_PROC_BROWSER_TEST_F(ShelfBrowserTest, StatusBubble) {
@@ -40,3 +44,23 @@ IN_PROC_BROWSER_TEST_F(ShelfBrowserTest, StatusBubble) {
browser()->window()->SetBounds(bounds);
EXPECT_TRUE(shelf_layout_manager->window_overlaps_shelf());
}
+
+class ShelfGuestSessionBrowserTest : public InProcessBrowserTest {
+ protected:
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ command_line->AppendSwitch(chromeos::switches::kGuestSession);
+ command_line->AppendSwitch(::switches::kIncognito);
+ command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "hash");
+ command_line->AppendSwitchASCII(
+ chromeos::switches::kLoginUser,
+ user_manager::GuestAccountId().GetUserEmail());
+ }
+};
+
+// Tests that in guest session, shelf alignment could be initialized to bottom
+// aligned, instead of bottom locked (crbug.com/699661).
+IN_PROC_BROWSER_TEST_F(ShelfGuestSessionBrowserTest, ShelfAlignment) {
+ ash::WmShelf* shelf = ash::WmShelf::ForWindow(
+ ash::WmWindow::Get(browser()->window()->GetNativeWindow()));
+ EXPECT_EQ(ash::SHELF_ALIGNMENT_BOTTOM, shelf->alignment());
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698