Home | History | Annotate | Download | only in login
      1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/chromeos/login/user_controller.h"
      6 
      7 #include "base/utf_string_conversions.h"
      8 #include "chrome/browser/chromeos/login/user_manager.h"
      9 #include "grit/generated_resources.h"
     10 #include "testing/gtest/include/gtest/gtest.h"
     11 #include "ui/base/l10n/l10n_util.h"
     12 
     13 namespace chromeos {
     14 
     15 TEST(UserControllerTest, GetNameTooltip) {
     16   UserController guest_user_controller(NULL, false);
     17   EXPECT_EQ(UTF16ToWide(l10n_util::GetStringUTF16(IDS_ADD_USER)),
     18             guest_user_controller.GetNameTooltip());
     19 
     20   UserController new_user_controller(NULL, true);
     21   EXPECT_EQ(UTF16ToWide(l10n_util::GetStringUTF16(IDS_GO_INCOGNITO_BUTTON)),
     22             new_user_controller.GetNameTooltip());
     23 
     24   UserManager::User existing_user;
     25   existing_user.set_email("someordinaryuser (at) domain.com");
     26   UserController existing_user_controller(NULL, existing_user);
     27   EXPECT_EQ(L"someordinaryuser (domain.com)",
     28             existing_user_controller.GetNameTooltip());
     29 }
     30 
     31 }  // namespace chromeos
     32