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

Unified Diff: chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests. Created 4 years, 10 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/extensions/api/networking_private/networking_private_chromeos_apitest.cc
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc
index f11313f36dc28e8c0373bfe2116186c050fd20d4..32709b62df461acb235e723ee18aa7361c09b923 100644
--- a/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc
+++ b/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_chromeos.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chromeos/chromeos_switches.h"
+#include "chromeos/cryptohome/cryptohome_parameters.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/shill_device_client.h"
@@ -195,8 +196,11 @@ class NetworkingPrivateChromeOSApiTest : public ExtensionApiTest {
// TODO(pneubeck): Remove the following hack, once the NetworkingPrivateAPI
// uses the ProfileHelper to obtain the userhash crbug/238623.
- const std::string login_user = chromeos::login::CanonicalizeUserID(
- command_line->GetSwitchValueNative(chromeos::switches::kLoginUser));
+ const cryptohome::Identification login_user =
+ cryptohome::Identification::FromString(
+ chromeos::login::CanonicalizeUserID(
+ command_line->GetSwitchValueNative(
+ chromeos::switches::kLoginUser)));
const std::string sanitized_user =
CryptohomeClient::GetStubSanitizedUsername(login_user);
command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile,
@@ -209,7 +213,8 @@ class NetworkingPrivateChromeOSApiTest : public ExtensionApiTest {
CHECK(user);
std::string userhash;
DBusThreadManager::Get()->GetCryptohomeClient()->GetSanitizedUsername(
- user->email(), base::Bind(&AssignString, &userhash_));
+ cryptohome::Identification(user->GetAccountId()),
+ base::Bind(&AssignString, &userhash_));
content::RunAllPendingInMessageLoop();
CHECK(!userhash_.empty());
}

Powered by Google App Engine
This is Rietveld 408576698