OLD | NEW |
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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" | 10 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" |
11 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 11 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
14 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
15 #include "components/content_settings/core/common/content_settings_types.h" | 15 #include "components/content_settings/core/common/content_settings_types.h" |
16 #include "content/public/test/test_navigation_observer.h" | 16 #include "content/public/test/test_navigation_observer.h" |
17 #include "net/test/spawned_test_server/spawned_test_server.h" | 17 #include "net/test/spawned_test_server/spawned_test_server.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 const base::FilePath::CharType kDocRoot[] = | 20 const base::FilePath::CharType kDocRoot[] = |
21 FILE_PATH_LITERAL("chrome/test/data"); | 21 FILE_PATH_LITERAL("chrome/test/data"); |
22 | 22 |
23 class ContentSettingBubbleModelMixedScriptTest : public InProcessBrowserTest { | 23 class ContentSettingBubbleModelMixedScriptTest : public InProcessBrowserTest { |
24 protected: | 24 protected: |
25 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 25 virtual void SetUpInProcessBrowserTestFixture() override { |
26 https_server_.reset( | 26 https_server_.reset( |
27 new net::SpawnedTestServer( | 27 new net::SpawnedTestServer( |
28 net::SpawnedTestServer::TYPE_HTTPS, | 28 net::SpawnedTestServer::TYPE_HTTPS, |
29 net::SpawnedTestServer::SSLOptions( | 29 net::SpawnedTestServer::SSLOptions( |
30 net::SpawnedTestServer::SSLOptions::CERT_OK), | 30 net::SpawnedTestServer::SSLOptions::CERT_OK), |
31 base::FilePath(kDocRoot))); | 31 base::FilePath(kDocRoot))); |
32 ASSERT_TRUE(https_server_->Start()); | 32 ASSERT_TRUE(https_server_->Start()); |
33 } | 33 } |
34 | 34 |
35 TabSpecificContentSettings* GetActiveTabSpecificContentSettings() { | 35 TabSpecificContentSettings* GetActiveTabSpecificContentSettings() { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 CONTENT_SETTINGS_TYPE_MIXEDSCRIPT)); | 90 CONTENT_SETTINGS_TYPE_MIXEDSCRIPT)); |
91 model->OnCustomLinkClicked(); | 91 model->OnCustomLinkClicked(); |
92 | 92 |
93 content::TestNavigationObserver observer( | 93 content::TestNavigationObserver observer( |
94 browser()->tab_strip_model()->GetActiveWebContents()); | 94 browser()->tab_strip_model()->GetActiveWebContents()); |
95 observer.Wait(); | 95 observer.Wait(); |
96 | 96 |
97 EXPECT_FALSE(GetActiveTabSpecificContentSettings()->IsContentBlocked( | 97 EXPECT_FALSE(GetActiveTabSpecificContentSettings()->IsContentBlocked( |
98 CONTENT_SETTINGS_TYPE_MIXEDSCRIPT)); | 98 CONTENT_SETTINGS_TYPE_MIXEDSCRIPT)); |
99 } | 99 } |
OLD | NEW |