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

Side by Side Diff: ios/chrome/browser/web/tab_id_tab_helper_unittest.mm

Issue 2956483003: [ios] TabIdTabHelper (Closed)
Patch Set: Refactor Tab to use TabIDTabHelper. Created 3 years, 6 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
(Empty)
1 // Copyright 2017 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 #import "ios/chrome/browser/web/tab_id_tab_helper.h"
6
7 #import "ios/web/public/test/fakes/test_web_state.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "testing/platform_test.h"
10
11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support."
13 #endif
14
15 // Test fixture for TabIDTabHelper class.
16 class TabIDTabHelperTest : public PlatformTest {
17 protected:
18 web::TestWebState first_web_state_;
19 web::TestWebState second_web_state_;
20 };
21
22 // Tests that a TabID is returned for a WebState, and TabID's are different
23 // for different WebStates.
24 TEST_F(TabIDTabHelperTest, TabIDForWebState) {
25 TabIDTabHelper::CreateForWebState(&first_web_state_);
26 TabIDTabHelper::CreateForWebState(&second_web_state_);
27
28 const TabID& first_tab_id =
29 TabIDTabHelper::FromWebState(&first_web_state_)->tab_id();
30 const TabID& second_tab_id =
31 TabIDTabHelper::FromWebState(&second_web_state_)->tab_id();
32
33 EXPECT_FALSE(first_tab_id.empty());
34 EXPECT_FALSE(second_tab_id.empty());
35 EXPECT_NE(first_tab_id, second_tab_id);
36 }
OLDNEW
« ios/chrome/browser/web/tab_id_tab_helper.mm ('K') | « ios/chrome/browser/web/tab_id_tab_helper.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698