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

Side by Side Diff: ppapi/tests/test_url_util.cc

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USELESS PATCH TITLE Created 8 years, 9 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 | « ppapi/tests/test_url_loader.cc ('k') | ppapi/tests/test_utils.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/tests/test_url_util.h" 5 #include "ppapi/tests/test_url_util.h"
6 6
7 #include "ppapi/c/dev/ppb_url_util_dev.h" 7 #include "ppapi/c/dev/ppb_url_util_dev.h"
8 #include "ppapi/cpp/dev/url_util_dev.h" 8 #include "ppapi/cpp/dev/url_util_dev.h"
9 #include "ppapi/tests/testing_instance.h" 9 #include "ppapi/tests/testing_instance.h"
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 ASSERT_FALSE(util_->IsSameSecurityOrigin("http://google.com/", 101 ASSERT_FALSE(util_->IsSameSecurityOrigin("http://google.com/",
102 "http://example.com/")); 102 "http://example.com/"));
103 ASSERT_TRUE(util_->IsSameSecurityOrigin("http://google.com/foo", 103 ASSERT_TRUE(util_->IsSameSecurityOrigin("http://google.com/foo",
104 "http://google.com/bar")); 104 "http://google.com/bar"));
105 PASS(); 105 PASS();
106 } 106 }
107 107
108 std::string TestURLUtil::TestDocumentCanRequest() { 108 std::string TestURLUtil::TestDocumentCanRequest() {
109 // This is hard to test, but we can at least verify we can't request 109 // This is hard to test, but we can at least verify we can't request
110 // some random domain. 110 // some random domain.
111 ASSERT_FALSE(util_->DocumentCanRequest(*instance_, "http://evil.com/")); 111 ASSERT_FALSE(util_->DocumentCanRequest(instance_, "http://evil.com/"));
112 PASS(); 112 PASS();
113 } 113 }
114 114
115 std::string TestURLUtil::TestDocumentCanAccessDocument() { 115 std::string TestURLUtil::TestDocumentCanAccessDocument() {
116 // This is hard to test, but we can at least verify we can access ourselves. 116 // This is hard to test, but we can at least verify we can access ourselves.
117 ASSERT_TRUE(util_->DocumentCanAccessDocument(*instance_, *instance_)); 117 ASSERT_TRUE(util_->DocumentCanAccessDocument(instance_, instance_));
118 PASS(); 118 PASS();
119 } 119 }
120 120
121 std::string TestURLUtil::TestGetDocumentURL() { 121 std::string TestURLUtil::TestGetDocumentURL() {
122 pp::Var url = util_->GetDocumentURL(*instance_); 122 pp::Var url = util_->GetDocumentURL(instance_);
123 ASSERT_TRUE(url.is_string()); 123 ASSERT_TRUE(url.is_string());
124 pp::VarPrivate window = instance_->GetWindowObject(); 124 pp::VarPrivate window = instance_->GetWindowObject();
125 pp::Var href = window.GetProperty("location").GetProperty("href"); 125 pp::Var href = window.GetProperty("location").GetProperty("href");
126 ASSERT_TRUE(href.is_string()); 126 ASSERT_TRUE(href.is_string());
127 // In the test framework, they should be the same. 127 // In the test framework, they should be the same.
128 ASSERT_EQ(url.AsString(), href.AsString()); 128 ASSERT_EQ(url.AsString(), href.AsString());
129 PASS(); 129 PASS();
130 } 130 }
131 131
132 std::string TestURLUtil::TestGetPluginInstanceURL() { 132 std::string TestURLUtil::TestGetPluginInstanceURL() {
133 pp::Var url = util_->GetPluginInstanceURL(*instance_); 133 pp::Var url = util_->GetPluginInstanceURL(instance_);
134 ASSERT_TRUE(url.is_string()); 134 ASSERT_TRUE(url.is_string());
135 // see test_case.html 135 // see test_case.html
136 ASSERT_EQ(url.AsString(), "http://a.b.c/test"); 136 ASSERT_EQ(url.AsString(), "http://a.b.c/test");
137 PASS(); 137 PASS();
138 } 138 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_url_loader.cc ('k') | ppapi/tests/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698