OLD | NEW |
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> | 5 #include <string> |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 Extension::NO_FLAGS, &error)); | 60 Extension::NO_FLAGS, &error)); |
61 EXPECT_TRUE(extension.get()) << error; | 61 EXPECT_TRUE(extension.get()) << error; |
62 return extension; | 62 return extension; |
63 } | 63 } |
64 | 64 |
65 scoped_refptr<Extension> CreateTestResponseHeaderExtension() { | 65 scoped_refptr<Extension> CreateTestResponseHeaderExtension() { |
66 DictionaryValue manifest; | 66 DictionaryValue manifest; |
67 manifest.SetString("name", "An extension with web-accessible resources"); | 67 manifest.SetString("name", "An extension with web-accessible resources"); |
68 manifest.SetString("version", "2"); | 68 manifest.SetString("version", "2"); |
69 | 69 |
70 ListValue* web_accessible_list = new ListValue(); | 70 base::ListValue* web_accessible_list = new base::ListValue(); |
71 web_accessible_list->AppendString("test.dat"); | 71 web_accessible_list->AppendString("test.dat"); |
72 manifest.Set("web_accessible_resources", web_accessible_list); | 72 manifest.Set("web_accessible_resources", web_accessible_list); |
73 | 73 |
74 base::FilePath path; | 74 base::FilePath path; |
75 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &path)); | 75 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &path)); |
76 path = path.AppendASCII("extensions").AppendASCII("response_headers"); | 76 path = path.AppendASCII("extensions").AppendASCII("response_headers"); |
77 | 77 |
78 std::string error; | 78 std::string error; |
79 scoped_refptr<Extension> extension( | 79 scoped_refptr<Extension> extension( |
80 Extension::Create(path, Manifest::UNPACKED, manifest, | 80 Extension::Create(path, Manifest::UNPACKED, manifest, |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 // We set test.dat as web-accessible, so it should have a CORS header. | 259 // We set test.dat as web-accessible, so it should have a CORS header. |
260 std::string access_control; | 260 std::string access_control; |
261 request.GetResponseHeaderByName("Access-Control-Allow-Origin", | 261 request.GetResponseHeaderByName("Access-Control-Allow-Origin", |
262 &access_control); | 262 &access_control); |
263 EXPECT_EQ("*", access_control); | 263 EXPECT_EQ("*", access_control); |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 } // namespace extensions | 267 } // namespace extensions |
OLD | NEW |