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

Side by Side Diff: chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc

Issue 10946011: Switch CaptivePortalTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/captive_portal/captive_portal_tab_helper.h" 5 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/captive_portal/captive_portal_service.h" 9 #include "chrome/browser/captive_portal/captive_portal_service.h"
10 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h" 10 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 MOCK_METHOD2(OnCaptivePortalResults, void(Result, Result)); 58 MOCK_METHOD2(OnCaptivePortalResults, void(Result, Result));
59 }; 59 };
60 60
61 // Inherits from the TabContentsTestHarness to gain access to 61 // Inherits from the TabContentsTestHarness to gain access to
62 // CreateTestWebContents. Since the tests need to micromanage order of 62 // CreateTestWebContents. Since the tests need to micromanage order of
63 // WebContentsObserver function calls, does not actually make sure of 63 // WebContentsObserver function calls, does not actually make sure of
64 // the harness in any other way. 64 // the harness in any other way.
65 class CaptivePortalTabHelperTest : public TabContentsTestHarness { 65 class CaptivePortalTabHelperTest : public TabContentsTestHarness {
66 public: 66 public:
67 CaptivePortalTabHelperTest() 67 CaptivePortalTabHelperTest()
68 : tab_helper_(NULL, NULL), 68 : tab_helper_(NULL),
69 mock_reloader_(new testing::StrictMock<MockCaptivePortalTabReloader>), 69 mock_reloader_(new testing::StrictMock<MockCaptivePortalTabReloader>),
70 ui_thread_(content::BrowserThread::UI, &message_loop_) { 70 ui_thread_(content::BrowserThread::UI, &message_loop_) {
71 tab_helper_.SetTabReloaderForTest(mock_reloader_); 71 tab_helper_.SetTabReloaderForTest(mock_reloader_);
72 } 72 }
73 virtual ~CaptivePortalTabHelperTest() {} 73 virtual ~CaptivePortalTabHelperTest() {}
74 74
75 virtual void SetUp() OVERRIDE { 75 virtual void SetUp() OVERRIDE {
76 TabContentsTestHarness::SetUp(); 76 TabContentsTestHarness::SetUp();
77 web_contents1_.reset(CreateTestWebContents()); 77 web_contents1_.reset(CreateTestWebContents());
78 web_contents2_.reset(CreateTestWebContents()); 78 web_contents2_.reset(CreateTestWebContents());
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 EXPECT_FALSE(tab_helper().IsLoginTab()); 610 EXPECT_FALSE(tab_helper().IsLoginTab());
611 611
612 ObservePortalResult(RESULT_BEHIND_CAPTIVE_PORTAL, RESULT_NO_RESPONSE); 612 ObservePortalResult(RESULT_BEHIND_CAPTIVE_PORTAL, RESULT_NO_RESPONSE);
613 EXPECT_FALSE(tab_helper().IsLoginTab()); 613 EXPECT_FALSE(tab_helper().IsLoginTab());
614 614
615 ObservePortalResult(RESULT_NO_RESPONSE, RESULT_INTERNET_CONNECTED); 615 ObservePortalResult(RESULT_NO_RESPONSE, RESULT_INTERNET_CONNECTED);
616 EXPECT_FALSE(tab_helper().IsLoginTab()); 616 EXPECT_FALSE(tab_helper().IsLoginTab());
617 } 617 }
618 618
619 } // namespace captive_portal 619 } // namespace captive_portal
OLDNEW
« no previous file with comments | « chrome/browser/captive_portal/captive_portal_tab_helper.cc ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698