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 <map> | 5 #include <map> |
6 #include <queue> | 6 #include <queue> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 EXPECT_EQ(i, ipc_sender_.sent_end()); | 688 EXPECT_EQ(i, ipc_sender_.sent_end()); |
689 } | 689 } |
690 | 690 |
691 TEST_F(ExtensionWebRequestTest, NoAccessRequestBodyData) { | 691 TEST_F(ExtensionWebRequestTest, NoAccessRequestBodyData) { |
692 // We verify that URLRequest body is NOT accessible to OnBeforeRequest | 692 // We verify that URLRequest body is NOT accessible to OnBeforeRequest |
693 // listeners when the type of the request is different from POST or PUT, or | 693 // listeners when the type of the request is different from POST or PUT, or |
694 // when the request body is empty. 3 requests are fired, without upload data, | 694 // when the request body is empty. 3 requests are fired, without upload data, |
695 // a POST, PUT and GET request. For none of them the "requestBody" object | 695 // a POST, PUT and GET request. For none of them the "requestBody" object |
696 // property should be present in the details passed to the onBeforeRequest | 696 // property should be present in the details passed to the onBeforeRequest |
697 // event listener. | 697 // event listener. |
698 const char* kMethods[] = { "POST", "PUT", "GET" }; | 698 const char* const kMethods[] = { "POST", "PUT", "GET" }; |
699 | 699 |
700 // Set up a dummy extension name. | 700 // Set up a dummy extension name. |
701 const std::string kEventName(web_request::OnBeforeRequest::kEventName); | 701 const std::string kEventName(web_request::OnBeforeRequest::kEventName); |
702 ExtensionWebRequestEventRouter::RequestFilter filter; | 702 ExtensionWebRequestEventRouter::RequestFilter filter; |
703 const std::string extension_id("1"); | 703 const std::string extension_id("1"); |
704 int extra_info_spec = 0; | 704 int extra_info_spec = 0; |
705 ASSERT_TRUE(GenerateInfoSpec("blocking,requestBody", &extra_info_spec)); | 705 ASSERT_TRUE(GenerateInfoSpec("blocking,requestBody", &extra_info_spec)); |
706 base::WeakPtrFactory<TestIPCSender> ipc_sender_factory(&ipc_sender_); | 706 base::WeakPtrFactory<TestIPCSender> ipc_sender_factory(&ipc_sender_); |
707 | 707 |
708 // Subscribe to OnBeforeRequest with requestBody requirement. | 708 // Subscribe to OnBeforeRequest with requestBody requirement. |
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2224 EXPECT_TRUE(credentials_set); | 2224 EXPECT_TRUE(credentials_set); |
2225 EXPECT_FALSE(auth3.Empty()); | 2225 EXPECT_FALSE(auth3.Empty()); |
2226 EXPECT_EQ(username, auth1.username()); | 2226 EXPECT_EQ(username, auth1.username()); |
2227 EXPECT_EQ(password, auth1.password()); | 2227 EXPECT_EQ(password, auth1.password()); |
2228 EXPECT_EQ(1u, warning_set.size()); | 2228 EXPECT_EQ(1u, warning_set.size()); |
2229 EXPECT_TRUE(HasWarning(warning_set, "extid2")); | 2229 EXPECT_TRUE(HasWarning(warning_set, "extid2")); |
2230 EXPECT_EQ(3u, capturing_net_log.GetSize()); | 2230 EXPECT_EQ(3u, capturing_net_log.GetSize()); |
2231 } | 2231 } |
2232 | 2232 |
2233 } // namespace extensions | 2233 } // namespace extensions |
OLD | NEW |