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

Side by Side Diff: webkit/fileapi/file_system_url_unittest.cc

Issue 15754005: Fix dependency: make file_system_util not depend on FileSystemURL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « webkit/fileapi/file_system_url.cc ('k') | webkit/fileapi/file_system_util.h » ('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) 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 "webkit/fileapi/file_system_url.h" 5 #include "webkit/fileapi/file_system_url.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "webkit/fileapi/file_system_types.h" 10 #include "webkit/fileapi/file_system_types.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 const GURL kOrigin("http://example.com"); 161 const GURL kOrigin("http://example.com");
162 const base::FilePath kPath(FPL("dir/file")); 162 const base::FilePath kPath(FPL("dir/file"));
163 163
164 const FileSystemURL kURL1 = FileSystemURL::CreateForTest( 164 const FileSystemURL kURL1 = FileSystemURL::CreateForTest(
165 kOrigin, kFileSystemTypeTemporary, kPath); 165 kOrigin, kFileSystemTypeTemporary, kPath);
166 EXPECT_EQ("filesystem:http://example.com/temporary/" + 166 EXPECT_EQ("filesystem:http://example.com/temporary/" +
167 NormalizedUTF8Path(kPath), 167 NormalizedUTF8Path(kPath),
168 kURL1.DebugString()); 168 kURL1.DebugString());
169 } 169 }
170 170
171 TEST(FileSystemURLTest, IsInSameFileSystem) {
172 FileSystemURL url_foo_temp_a = FileSystemURL::CreateForTest(
173 GURL("http://foo"), kFileSystemTypeTemporary,
174 base::FilePath::FromUTF8Unsafe("a"));
175 FileSystemURL url_foo_temp_b = FileSystemURL::CreateForTest(
176 GURL("http://foo"), kFileSystemTypeTemporary,
177 base::FilePath::FromUTF8Unsafe("b"));
178 FileSystemURL url_foo_perm_a = FileSystemURL::CreateForTest(
179 GURL("http://foo"), kFileSystemTypePersistent,
180 base::FilePath::FromUTF8Unsafe("a"));
181 FileSystemURL url_bar_temp_a = FileSystemURL::CreateForTest(
182 GURL("http://bar"), kFileSystemTypeTemporary,
183 base::FilePath::FromUTF8Unsafe("a"));
184 FileSystemURL url_bar_perm_a = FileSystemURL::CreateForTest(
185 GURL("http://bar"), kFileSystemTypePersistent,
186 base::FilePath::FromUTF8Unsafe("a"));
187
188 EXPECT_TRUE(url_foo_temp_a.IsInSameFileSystem(url_foo_temp_a));
189 EXPECT_TRUE(url_foo_temp_a.IsInSameFileSystem(url_foo_temp_b));
190 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_foo_perm_a));
191 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_bar_temp_a));
192 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_bar_perm_a));
193 }
194
171 } // namespace fileapi 195 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_url.cc ('k') | webkit/fileapi/file_system_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698