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

Unified Diff: chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc

Issue 840673004: The User Manager needs to use profile paths not display names for profile switching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests on windows too. paths. sigh. Created 5 years, 11 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
Index: chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc
diff --git a/chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc b/chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc
index 1b11876e52c8e02dc6f201471de438d1daf0c70b..de7018c8f79374ccf32809e3cfc6fc5524881afe 100644
--- a/chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/command_line.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -75,12 +76,14 @@ IN_PROC_BROWSER_TEST_F(UserManagerUIBrowserTest, PageRedirectsToAboutChrome) {
content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
- base::string16 profile_name =
- profiles::GetAvatarNameForProfile(browser()->profile()->GetPath());
+ // If this is a Windows style path, escape all the slashes.
+ std::string profile_path;
+ base::ReplaceChars(browser()->profile()->GetPath().MaybeAsASCII(),
+ "\\", "\\\\", &profile_path);
std::string launch_js =
- base::StringPrintf("Oobe.launchUser('', '%s')",
- base::UTF16ToUTF8(profile_name).c_str());
+ base::StringPrintf("Oobe.launchUser('%s')", profile_path.c_str());
+
bool result = content::ExecuteScript(web_contents, launch_js);
EXPECT_TRUE(result);
base::RunLoop().RunUntilIdle();
« no previous file with comments | « chrome/browser/ui/webui/signin/user_manager_screen_handler.cc ('k') | ui/login/account_picker/user_pod_row.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698