| OLD | NEW |
| 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" |
| 11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
| 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 13 #include "content/public/browser/notification_details.h" | 13 #include "content/public/browser/notification_details.h" |
| 14 #include "content/public/browser/notification_service.h" | 14 #include "content/public/browser/notification_service.h" |
| 15 #include "content/public/browser/notification_source.h" | 15 #include "content/public/browser/notification_source.h" |
| 16 #include "content/public/browser/notification_types.h" | 16 #include "content/public/browser/notification_types.h" |
| 17 #include "content/public/browser/render_view_host.h" | 17 #include "content/public/browser/render_view_host.h" |
| 18 #include "content/public/browser/render_process_host.h" | 18 #include "content/public/browser/render_process_host.h" |
| 19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
| 20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
| 21 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 23 |
| 24 using captive_portal::CaptivePortalResult; | 24 using captive_portal::CaptivePortalResult; |
| 25 using content::ResourceType; |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| 27 | 28 |
| 28 const char* const kHttpUrl = "http://whatever.com/"; | 29 const char* const kHttpUrl = "http://whatever.com/"; |
| 29 const char* const kHttpsUrl = "https://whatever.com/"; | 30 const char* const kHttpsUrl = "https://whatever.com/"; |
| 30 | 31 |
| 31 // Used for cross-process navigations. Shouldn't actually matter whether this | 32 // Used for cross-process navigations. Shouldn't actually matter whether this |
| 32 // is different from kHttpsUrl, but best to keep things consistent. | 33 // is different from kHttpsUrl, but best to keep things consistent. |
| 33 const char* const kHttpsUrl2 = "https://cross_process.com/"; | 34 const char* const kHttpsUrl2 = "https://cross_process.com/"; |
| 34 | 35 |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 EXPECT_FALSE(tab_helper().IsLoginTab()); | 629 EXPECT_FALSE(tab_helper().IsLoginTab()); |
| 629 | 630 |
| 630 ObservePortalResult(captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL, | 631 ObservePortalResult(captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL, |
| 631 captive_portal::RESULT_NO_RESPONSE); | 632 captive_portal::RESULT_NO_RESPONSE); |
| 632 EXPECT_FALSE(tab_helper().IsLoginTab()); | 633 EXPECT_FALSE(tab_helper().IsLoginTab()); |
| 633 | 634 |
| 634 ObservePortalResult(captive_portal::RESULT_NO_RESPONSE, | 635 ObservePortalResult(captive_portal::RESULT_NO_RESPONSE, |
| 635 captive_portal::RESULT_INTERNET_CONNECTED); | 636 captive_portal::RESULT_INTERNET_CONNECTED); |
| 636 EXPECT_FALSE(tab_helper().IsLoginTab()); | 637 EXPECT_FALSE(tab_helper().IsLoginTab()); |
| 637 } | 638 } |
| OLD | NEW |