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

Side by Side Diff: webkit/browser/fileapi/sandbox_isolated_origin_database_unittest.cc

Issue 253753007: Move all remaining fileapi and quota unit tests from webkit/ to content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address feedback Created 6 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
OLDNEW
(Empty)
1 // Copyright 2013 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 "base/basictypes.h"
6 #include "base/file_util.h"
7 #include "base/files/scoped_temp_dir.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "webkit/browser/fileapi/sandbox_isolated_origin_database.h"
10 #include "webkit/browser/fileapi/sandbox_origin_database.h"
11
12 namespace fileapi {
13
14 namespace {
15 const base::FilePath::CharType kOriginDirectory[] = FILE_PATH_LITERAL("iso");
16 } // namespace
17
18 TEST(SandboxIsolatedOriginDatabaseTest, BasicTest) {
19 base::ScopedTempDir dir;
20 ASSERT_TRUE(dir.CreateUniqueTempDir());
21
22 std::string kOrigin("origin");
23 SandboxIsolatedOriginDatabase database(kOrigin, dir.path(),
24 base::FilePath(kOriginDirectory));
25
26 EXPECT_TRUE(database.HasOriginPath(kOrigin));
27
28 base::FilePath path1, path2;
29
30 EXPECT_FALSE(database.GetPathForOrigin(std::string(), &path1));
31 EXPECT_FALSE(database.GetPathForOrigin("foo", &path1));
32
33 EXPECT_TRUE(database.HasOriginPath(kOrigin));
34 EXPECT_TRUE(database.GetPathForOrigin(kOrigin, &path1));
35 EXPECT_TRUE(database.GetPathForOrigin(kOrigin, &path2));
36 EXPECT_FALSE(path1.empty());
37 EXPECT_FALSE(path2.empty());
38 EXPECT_EQ(path1, path2);
39 }
40
41 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698