Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / ios / web / browser_state_unittest.cc
blobf235bb6ed9af31dc54067949e875c3fcc1e34e5e
1 // Copyright 2014 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.
5 #include "ios/web/public/browser_state.h"
7 #include "base/supports_user_data.h"
8 #include "ios/web/public/test/test_browser_state.h"
9 #include "testing/gtest/include/gtest/gtest.h"
11 namespace {
12 class TestSupportsUserData : public base::SupportsUserData {
13 public:
14 TestSupportsUserData() {}
15 ~TestSupportsUserData() override {}
17 } // namespace
19 TEST(BrowserStateTest, FromSupportsUserData_NullPointer) {
20 DCHECK_EQ(static_cast<web::BrowserState*>(nullptr),
21 web::BrowserState::FromSupportsUserData(nullptr));
24 TEST(BrowserStateTest, FromSupportsUserData_NonBrowserState) {
25 TestSupportsUserData supports_user_data;
26 DCHECK_EQ(static_cast<web::BrowserState*>(nullptr),
27 web::BrowserState::FromSupportsUserData(&supports_user_data));
30 TEST(BrowserStateTest, FromSupportsUserData) {
31 web::TestBrowserState browser_state;
32 DCHECK_EQ(&browser_state,
33 web::BrowserState::FromSupportsUserData(&browser_state));