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

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

Issue 815363002: replace COMPILE_ASSERT with static_assert in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 12 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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 keys::kRequestBodyRawBytesKey, 596 keys::kRequestBodyRawBytesKey,
597 BinaryValue::CreateWithCopiedBuffer(kPlainBlock2, kPlainBlock2Length), 597 BinaryValue::CreateWithCopiedBuffer(kPlainBlock2, kPlainBlock2Length),
598 &raw); 598 &raw);
599 // Summary. 599 // Summary.
600 const base::Value* const kExpected[] = { 600 const base::Value* const kExpected[] = {
601 form_data.get(), 601 form_data.get(),
602 NULL, 602 NULL,
603 &raw, 603 &raw,
604 &raw, 604 &raw,
605 }; 605 };
606 COMPILE_ASSERT(arraysize(kPath) == arraysize(kExpected), 606 static_assert(arraysize(kPath) == arraysize(kExpected),
607 the_arrays_kPath_and_kExpected_need_to_be_the_same_size); 607 "kPath and kExpected arrays should have the same number "
608 "of elements");
608 // Header. 609 // Header.
609 const char kMultipart[] = "multipart/form-data; boundary=" kBoundary; 610 const char kMultipart[] = "multipart/form-data; boundary=" kBoundary;
610 #undef kBoundary 611 #undef kBoundary
611 612
612 // Set up a dummy extension name. 613 // Set up a dummy extension name.
613 const std::string kEventName(web_request::OnBeforeRequest::kEventName); 614 const std::string kEventName(web_request::OnBeforeRequest::kEventName);
614 ExtensionWebRequestEventRouter::RequestFilter filter; 615 ExtensionWebRequestEventRouter::RequestFilter filter;
615 std::string extension_id("1"); 616 std::string extension_id("1");
616 const std::string string_spec_post("blocking,requestBody"); 617 const std::string string_spec_post("blocking,requestBody");
617 const std::string string_spec_no_post("blocking"); 618 const std::string string_spec_no_post("blocking");
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2225 EXPECT_TRUE(credentials_set); 2226 EXPECT_TRUE(credentials_set);
2226 EXPECT_FALSE(auth3.Empty()); 2227 EXPECT_FALSE(auth3.Empty());
2227 EXPECT_EQ(username, auth1.username()); 2228 EXPECT_EQ(username, auth1.username());
2228 EXPECT_EQ(password, auth1.password()); 2229 EXPECT_EQ(password, auth1.password());
2229 EXPECT_EQ(1u, warning_set.size()); 2230 EXPECT_EQ(1u, warning_set.size());
2230 EXPECT_TRUE(HasWarning(warning_set, "extid2")); 2231 EXPECT_TRUE(HasWarning(warning_set, "extid2"));
2231 EXPECT_EQ(3u, capturing_net_log.GetSize()); 2232 EXPECT_EQ(3u, capturing_net_log.GetSize());
2232 } 2233 }
2233 2234
2234 } // namespace extensions 2235 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/proxy/proxy_api_helpers.cc ('k') | chrome/browser/external_extension_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698