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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix cros, really Created 6 years, 2 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
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 <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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 EXPECT_EQ(i, ipc_sender_.sent_end()); 689 EXPECT_EQ(i, ipc_sender_.sent_end());
690 } 690 }
691 691
692 TEST_F(ExtensionWebRequestTest, NoAccessRequestBodyData) { 692 TEST_F(ExtensionWebRequestTest, NoAccessRequestBodyData) {
693 // We verify that URLRequest body is NOT accessible to OnBeforeRequest 693 // We verify that URLRequest body is NOT accessible to OnBeforeRequest
694 // listeners when the type of the request is different from POST or PUT, or 694 // listeners when the type of the request is different from POST or PUT, or
695 // when the request body is empty. 3 requests are fired, without upload data, 695 // when the request body is empty. 3 requests are fired, without upload data,
696 // a POST, PUT and GET request. For none of them the "requestBody" object 696 // a POST, PUT and GET request. For none of them the "requestBody" object
697 // property should be present in the details passed to the onBeforeRequest 697 // property should be present in the details passed to the onBeforeRequest
698 // event listener. 698 // event listener.
699 const char* kMethods[] = { "POST", "PUT", "GET" }; 699 const char* const kMethods[] = { "POST", "PUT", "GET" };
700 700
701 // Set up a dummy extension name. 701 // Set up a dummy extension name.
702 const std::string kEventName(web_request::OnBeforeRequest::kEventName); 702 const std::string kEventName(web_request::OnBeforeRequest::kEventName);
703 ExtensionWebRequestEventRouter::RequestFilter filter; 703 ExtensionWebRequestEventRouter::RequestFilter filter;
704 const std::string extension_id("1"); 704 const std::string extension_id("1");
705 int extra_info_spec = 0; 705 int extra_info_spec = 0;
706 ASSERT_TRUE(GenerateInfoSpec("blocking,requestBody", &extra_info_spec)); 706 ASSERT_TRUE(GenerateInfoSpec("blocking,requestBody", &extra_info_spec));
707 base::WeakPtrFactory<TestIPCSender> ipc_sender_factory(&ipc_sender_); 707 base::WeakPtrFactory<TestIPCSender> ipc_sender_factory(&ipc_sender_);
708 708
709 // Subscribe to OnBeforeRequest with requestBody requirement. 709 // Subscribe to OnBeforeRequest with requestBody requirement.
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after
2225 EXPECT_TRUE(credentials_set); 2225 EXPECT_TRUE(credentials_set);
2226 EXPECT_FALSE(auth3.Empty()); 2226 EXPECT_FALSE(auth3.Empty());
2227 EXPECT_EQ(username, auth1.username()); 2227 EXPECT_EQ(username, auth1.username());
2228 EXPECT_EQ(password, auth1.password()); 2228 EXPECT_EQ(password, auth1.password());
2229 EXPECT_EQ(1u, warning_set.size()); 2229 EXPECT_EQ(1u, warning_set.size());
2230 EXPECT_TRUE(HasWarning(warning_set, "extid2")); 2230 EXPECT_TRUE(HasWarning(warning_set, "extid2"));
2231 EXPECT_EQ(3u, capturing_net_log.GetSize()); 2231 EXPECT_EQ(3u, capturing_net_log.GetSize());
2232 } 2232 }
2233 2233
2234 } // namespace extensions 2234 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698