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

Side by Side Diff: content/renderer/pepper/pepper_url_request_unittest.cc

Issue 451923002: Add a X-Requested-With header to URL requests for PPAPI Flash (only). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment about -1. Created 6 years, 4 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
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/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "content/public/common/user_agent.h" 6 #include "content/public/common/user_agent.h"
7 #include "content/public/test/render_view_test.h" 7 #include "content/public/test/render_view_test.h"
8 #include "content/renderer/pepper/url_request_info_util.h" 8 #include "content/renderer/pepper/url_request_info_util.h"
9 #include "ppapi/proxy/connection.h" 9 #include "ppapi/proxy/connection.h"
10 #include "ppapi/proxy/url_request_info_resource.h" 10 #include "ppapi/proxy/url_request_info_resource.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 } // namespace 47 } // namespace
48 48
49 using ppapi::proxy::URLRequestInfoResource; 49 using ppapi::proxy::URLRequestInfoResource;
50 using ppapi::URLRequestInfoData; 50 using ppapi::URLRequestInfoData;
51 51
52 namespace content { 52 namespace content {
53 53
54 class URLRequestInfoTest : public RenderViewTest { 54 class URLRequestInfoTest : public RenderViewTest {
55 public: 55 public:
56 URLRequestInfoTest() : pp_instance_(1234) {} 56 // Note: using -1 as the instance value allows code in
57 // url_request_info_util.cc to detect that this is a test instance.
58 URLRequestInfoTest() : pp_instance_(-1) {}
57 59
58 virtual void SetUp() OVERRIDE { 60 virtual void SetUp() OVERRIDE {
59 RenderViewTest::SetUp(); 61 RenderViewTest::SetUp();
60 ppapi::ProxyLock::DisableLockingOnThreadForTest(); 62 ppapi::ProxyLock::DisableLockingOnThreadForTest();
61 63
62 test_globals_.GetResourceTracker()->DidCreateInstance(pp_instance_); 64 test_globals_.GetResourceTracker()->DidCreateInstance(pp_instance_);
63 65
64 // This resource doesn't do IPC, so a null connection is fine. 66 // This resource doesn't do IPC, so a null connection is fine.
65 info_ = new URLRequestInfoResource( 67 info_ = new URLRequestInfoResource(
66 ppapi::proxy::Connection(), pp_instance_, URLRequestInfoData()); 68 ppapi::proxy::Connection(), pp_instance_, URLRequestInfoData());
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // Test that we can set multiple header fields using \n delimiter. 233 // Test that we can set multiple header fields using \n delimiter.
232 EXPECT_TRUE( 234 EXPECT_TRUE(
233 SetStringProperty(PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\nbar: baz")); 235 SetStringProperty(PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\nbar: baz"));
234 EXPECT_TRUE(IsExpected(GetHeaderValue("foo"), "bar")); 236 EXPECT_TRUE(IsExpected(GetHeaderValue("foo"), "bar"));
235 EXPECT_TRUE(IsExpected(GetHeaderValue("bar"), "baz")); 237 EXPECT_TRUE(IsExpected(GetHeaderValue("bar"), "baz"));
236 } 238 }
237 239
238 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. 240 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody.
239 241
240 } // namespace content 242 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_registry.cc ('k') | content/renderer/pepper/plugin_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698