| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 const base::FilePath::CharType kDocRoot[] = | 30 const base::FilePath::CharType kDocRoot[] = |
| 31 FILE_PATH_LITERAL("chrome/test/data/referrer_policy"); | 31 FILE_PATH_LITERAL("chrome/test/data/referrer_policy"); |
| 32 | 32 |
| 33 } // namespace | 33 } // namespace |
| 34 | 34 |
| 35 class ReferrerPolicyTest : public InProcessBrowserTest { | 35 class ReferrerPolicyTest : public InProcessBrowserTest { |
| 36 public: | 36 public: |
| 37 ReferrerPolicyTest() {} | 37 ReferrerPolicyTest() {} |
| 38 virtual ~ReferrerPolicyTest() {} | 38 virtual ~ReferrerPolicyTest() {} |
| 39 | 39 |
| 40 virtual void SetUp() OVERRIDE { | 40 virtual void SetUp() override { |
| 41 test_server_.reset(new net::SpawnedTestServer( | 41 test_server_.reset(new net::SpawnedTestServer( |
| 42 net::SpawnedTestServer::TYPE_HTTP, | 42 net::SpawnedTestServer::TYPE_HTTP, |
| 43 net::SpawnedTestServer::kLocalhost, | 43 net::SpawnedTestServer::kLocalhost, |
| 44 base::FilePath(kDocRoot))); | 44 base::FilePath(kDocRoot))); |
| 45 ASSERT_TRUE(test_server_->Start()); | 45 ASSERT_TRUE(test_server_->Start()); |
| 46 ssl_test_server_.reset(new net::SpawnedTestServer( | 46 ssl_test_server_.reset(new net::SpawnedTestServer( |
| 47 net::SpawnedTestServer::TYPE_HTTPS, | 47 net::SpawnedTestServer::TYPE_HTTPS, |
| 48 net::SpawnedTestServer::kLocalhost, | 48 net::SpawnedTestServer::kLocalhost, |
| 49 base::FilePath(kDocRoot))); | 49 base::FilePath(kDocRoot))); |
| 50 ASSERT_TRUE(ssl_test_server_->Start()); | 50 ASSERT_TRUE(ssl_test_server_->Start()); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 | 611 |
| 612 // Verify that the full url of the iframe was used as referrer. | 612 // Verify that the full url of the iframe was used as referrer. |
| 613 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 613 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 614 frame, | 614 frame, |
| 615 "window.domAutomationController.send(document.title)", | 615 "window.domAutomationController.send(document.title)", |
| 616 &title)); | 616 &title)); |
| 617 EXPECT_EQ("Referrer is " + | 617 EXPECT_EQ("Referrer is " + |
| 618 test_server_->GetURL("files/referrer-policy-log.html").spec(), | 618 test_server_->GetURL("files/referrer-policy-log.html").spec(), |
| 619 title); | 619 title); |
| 620 } | 620 } |
| OLD | NEW |