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

Side by Side Diff: content/common/common_param_traits_unittest.cc

Issue 1497743005: Allow huge data: URIs only via WebView.loadDataWithBaseUrl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the test Created 5 years 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 <string.h> 5 #include <string.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/public/common/common_param_traits.h" 10 #include "content/public/common/common_param_traits.h"
11 #include "content/public/common/url_utils.h" 11 #include "content/public/common/content_constants.h"
12 #include "ipc/ipc_message.h" 12 #include "ipc/ipc_message.h"
13 #include "ipc/ipc_message_utils.h" 13 #include "ipc/ipc_message_utils.h"
14 #include "net/base/host_port_pair.h" 14 #include "net/base/host_port_pair.h"
15 #include "printing/backend/print_backend.h" 15 #include "printing/backend/print_backend.h"
16 #include "printing/page_range.h" 16 #include "printing/page_range.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 #include "third_party/skia/include/core/SkBitmap.h" 18 #include "third_party/skia/include/core/SkBitmap.h"
19 #include "ui/gfx/geometry/rect.h" 19 #include "ui/gfx/geometry/rect.h"
20 #include "ui/gfx/ipc/gfx_param_traits.h" 20 #include "ui/gfx/ipc/gfx_param_traits.h"
21 #include "url/gurl.h" 21 #include "url/gurl.h"
(...skipping 24 matching lines...) Expand all
46 EXPECT_EQ(input.host(), output.host()); 46 EXPECT_EQ(input.host(), output.host());
47 EXPECT_EQ(input.port(), output.port()); 47 EXPECT_EQ(input.port(), output.port());
48 EXPECT_EQ(input.path(), output.path()); 48 EXPECT_EQ(input.path(), output.path());
49 EXPECT_EQ(input.query(), output.query()); 49 EXPECT_EQ(input.query(), output.query());
50 EXPECT_EQ(input.ref(), output.ref()); 50 EXPECT_EQ(input.ref(), output.ref());
51 } 51 }
52 52
53 // Test an excessively long GURL. 53 // Test an excessively long GURL.
54 { 54 {
55 const std::string url = std::string("http://example.org/").append( 55 const std::string url = std::string("http://example.org/").append(
56 content::GetMaxURLChars() + 1, 'a'); 56 content::kMaxURLChars + 1, 'a');
57 GURL input(url.c_str()); 57 GURL input(url.c_str());
58 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); 58 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
59 IPC::ParamTraits<GURL>::Write(&msg, input); 59 IPC::ParamTraits<GURL>::Write(&msg, input);
60 60
61 GURL output; 61 GURL output;
62 base::PickleIterator iter(msg); 62 base::PickleIterator iter(msg);
63 EXPECT_TRUE(IPC::ParamTraits<GURL>::Read(&msg, &iter, &output)); 63 EXPECT_TRUE(IPC::ParamTraits<GURL>::Read(&msg, &iter, &output));
64 EXPECT_TRUE(output.is_empty()); 64 EXPECT_TRUE(output.is_empty());
65 } 65 }
66 66
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); 200 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
201 IPC::ParamTraits<net::HostPortPair>::Write(&msg, input); 201 IPC::ParamTraits<net::HostPortPair>::Write(&msg, input);
202 202
203 net::HostPortPair output; 203 net::HostPortPair output;
204 base::PickleIterator iter(msg); 204 base::PickleIterator iter(msg);
205 EXPECT_TRUE(IPC::ParamTraits<net::HostPortPair>::Read(&msg, &iter, &output)); 205 EXPECT_TRUE(IPC::ParamTraits<net::HostPortPair>::Read(&msg, &iter, &output));
206 EXPECT_EQ(input.host(), output.host()); 206 EXPECT_EQ(input.host(), output.host());
207 EXPECT_EQ(input.port(), output.port()); 207 EXPECT_EQ(input.port(), output.port());
208 } 208 }
OLDNEW
« no previous file with comments | « content/child/service_worker/service_worker_dispatcher.cc ('k') | content/common/content_constants_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698