OLD | NEW |
| (Empty) |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/extensions/extension_protocols.h" | |
6 #include "testing/gtest/include/gtest/gtest.h" | |
7 | |
8 class ExtensionProtocolsTest : public testing::Test { | |
9 }; | |
10 | |
11 TEST(ExtensionProtocolsTest, GetPathForExtensionResource) { | |
12 #if defined(OS_WIN) | |
13 FilePath extension_path(FILE_PATH_LITERAL("C:\\myextension")); | |
14 EXPECT_EQ(std::wstring(L"C:\\myextension\\foo\\bar.gif"), | |
15 GetPathForExtensionResource(extension_path, "/foo/bar.gif").value())
; | |
16 EXPECT_EQ(std::wstring(L"C:\\myextension\\"), | |
17 GetPathForExtensionResource(extension_path, "/").value()); | |
18 EXPECT_EQ(std::wstring(L"C:\\myextension\\c:\\foo.gif"), | |
19 GetPathForExtensionResource(extension_path, "/c:/foo.gif").value()); | |
20 EXPECT_EQ(std::wstring(L""), | |
21 GetPathForExtensionResource(extension_path, "/../foo.gif").value()); | |
22 #else | |
23 FilePath extension_path(FILE_PATH_LITERAL("/myextension")); | |
24 EXPECT_EQ(std::wstring("/myextension/foo/bar.gif"), | |
25 GetPathForExtensionResource(extension_path, "/foo/bar.gif").value())
; | |
26 EXPECT_EQ(std::wstring("/myextension/"), | |
27 GetPathForExtensionResource(extension_path, "/").value()); | |
28 EXPECT_EQ(std::wstring(""), | |
29 GetPathForExtensionResource(extension_path, "/../foo.gif").value()); | |
30 #endif | |
31 | |
32 | |
33 } | |
OLD | NEW |