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

Side by Side Diff: ios/web/browser_state_unittest.cc

Issue 2614443004: [ios] Moved all web mocks to ios/web/public/test/fakes. (Closed)
Patch Set: Moved test_redirect_observer back Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ios/web/public/browser_state.h" 5 #include "ios/web/public/browser_state.h"
6 6
7 #include "base/supports_user_data.h" 7 #include "base/supports_user_data.h"
8 #include "ios/web/public/test/test_browser_state.h" 8 #include "ios/web/public/test/fakes/test_browser_state.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace { 11 namespace {
12 class TestSupportsUserData : public base::SupportsUserData { 12 class TestSupportsUserData : public base::SupportsUserData {
13 public: 13 public:
14 TestSupportsUserData() {} 14 TestSupportsUserData() {}
15 ~TestSupportsUserData() override {} 15 ~TestSupportsUserData() override {}
16 }; 16 };
17 } // namespace 17 } // namespace
18 18
19 TEST(BrowserStateTest, FromSupportsUserData_NullPointer) { 19 TEST(BrowserStateTest, FromSupportsUserData_NullPointer) {
20 DCHECK_EQ(static_cast<web::BrowserState*>(nullptr), 20 DCHECK_EQ(static_cast<web::BrowserState*>(nullptr),
21 web::BrowserState::FromSupportsUserData(nullptr)); 21 web::BrowserState::FromSupportsUserData(nullptr));
22 } 22 }
23 23
24 TEST(BrowserStateTest, FromSupportsUserData_NonBrowserState) { 24 TEST(BrowserStateTest, FromSupportsUserData_NonBrowserState) {
25 TestSupportsUserData supports_user_data; 25 TestSupportsUserData supports_user_data;
26 DCHECK_EQ(static_cast<web::BrowserState*>(nullptr), 26 DCHECK_EQ(static_cast<web::BrowserState*>(nullptr),
27 web::BrowserState::FromSupportsUserData(&supports_user_data)); 27 web::BrowserState::FromSupportsUserData(&supports_user_data));
28 } 28 }
29 29
30 TEST(BrowserStateTest, FromSupportsUserData) { 30 TEST(BrowserStateTest, FromSupportsUserData) {
31 web::TestBrowserState browser_state; 31 web::TestBrowserState browser_state;
32 DCHECK_EQ(&browser_state, 32 DCHECK_EQ(&browser_state,
33 web::BrowserState::FromSupportsUserData(&browser_state)); 33 web::BrowserState::FromSupportsUserData(&browser_state));
34 } 34 }
OLDNEW
« no previous file with comments | « ios/web/active_state_manager_impl_unittest.mm ('k') | ios/web/navigation/crw_session_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698