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

Side by Side Diff: net/base/data_url_unittest.cc

Issue 294193002: Set response headers for data URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « net/base/data_url.cc ('k') | net/net.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "net/base/data_url.h" 6 #include "net/base/data_url.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "url/gurl.h" 8 #include "url/gurl.h"
9 9
10 namespace { 10 namespace {
(...skipping 22 matching lines...) Expand all
33 "US-ASCII", 33 "US-ASCII",
34 "" }, 34 "" },
35 35
36 { "data:;base64,", 36 { "data:;base64,",
37 true, 37 true,
38 "text/plain", 38 "text/plain",
39 "US-ASCII", 39 "US-ASCII",
40 "" }, 40 "" },
41 41
42 { "data:;charset=,test", 42 { "data:;charset=,test",
43 true, 43 false,
44 "text/plain", 44 "",
45 "US-ASCII", 45 "",
46 "test" }, 46 "" },
47 47
48 { "data:TeXt/HtMl,<b>x</b>", 48 { "data:TeXt/HtMl,<b>x</b>",
49 true, 49 true,
50 "text/html", 50 "text/html",
51 "US-ASCII", 51 "US-ASCII",
52 "<b>x</b>" }, 52 "<b>x</b>" },
53 53
54 { "data:,foo", 54 { "data:,foo",
55 true, 55 true,
56 "text/plain", 56 "text/plain",
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 bool ok = 179 bool ok =
180 net::DataURL::Parse(GURL(tests[i].url), &mime_type, &charset, &data); 180 net::DataURL::Parse(GURL(tests[i].url), &mime_type, &charset, &data);
181 EXPECT_EQ(ok, tests[i].is_valid); 181 EXPECT_EQ(ok, tests[i].is_valid);
182 if (tests[i].is_valid) { 182 if (tests[i].is_valid) {
183 EXPECT_EQ(tests[i].mime_type, mime_type); 183 EXPECT_EQ(tests[i].mime_type, mime_type);
184 EXPECT_EQ(tests[i].charset, charset); 184 EXPECT_EQ(tests[i].charset, charset);
185 EXPECT_EQ(tests[i].data, data); 185 EXPECT_EQ(tests[i].data, data);
186 } 186 }
187 } 187 }
188 } 188 }
OLDNEW
« no previous file with comments | « net/base/data_url.cc ('k') | net/net.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698