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

Side by Side Diff: content/browser/webui/web_ui_data_source_unittest.cc

Issue 1217503012: Avoid cross-origin iframe issues when loading PDF in print preview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/browser/webui/web_ui_data_source_impl.h" 9 #include "content/browser/webui/web_ui_data_source_impl.h"
10 #include "content/public/test/test_browser_thread_bundle.h" 10 #include "content/public/test/test_browser_thread_bundle.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 EXPECT_EQ(GetMimeType(".js"), js); 139 EXPECT_EQ(GetMimeType(".js"), js);
140 EXPECT_EQ(GetMimeType("foo.js"), js); 140 EXPECT_EQ(GetMimeType("foo.js"), js);
141 EXPECT_EQ(GetMimeType("js"), html); 141 EXPECT_EQ(GetMimeType("js"), html);
142 EXPECT_EQ(GetMimeType("foojs"), html); 142 EXPECT_EQ(GetMimeType("foojs"), html);
143 EXPECT_EQ(GetMimeType("foo.jsp"), html); 143 EXPECT_EQ(GetMimeType("foo.jsp"), html);
144 EXPECT_EQ(GetMimeType("foocss"), html); 144 EXPECT_EQ(GetMimeType("foocss"), html);
145 EXPECT_EQ(GetMimeType("foo.css"), css); 145 EXPECT_EQ(GetMimeType("foo.css"), css);
146 EXPECT_EQ(GetMimeType(".css.foo"), html); 146 EXPECT_EQ(GetMimeType(".css.foo"), html);
147 } 147 }
148 148
149 TEST_F(WebUIDataSourceTest, QueryStringRemoval) {
150 std::string path = "path.js?query_string";
151 source()->source()->WillServiceRequest(nullptr, &path);
152 EXPECT_EQ("path.js", path);
153
154 path = "path.js?query_string?query_string2";
155 source()->source()->WillServiceRequest(nullptr, &path);
156 EXPECT_EQ("path.js", path);
157 }
158
149 } // namespace content 159 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698