OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/sync_file_system/drive_backend/task_dependency_manager.
h" | 5 #include "chrome/browser/sync_file_system/drive_backend/task_dependency_manager.
h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 #define FPL(path) FILE_PATH_LITERAL(path) | 10 #define FPL(path) FILE_PATH_LITERAL(path) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 EXPECT_FALSE(InsertPath(&manager, "app_id", FPL("/foo/bar"))); | 102 EXPECT_FALSE(InsertPath(&manager, "app_id", FPL("/foo/bar"))); |
103 EraseExclusiveTask(&manager); | 103 EraseExclusiveTask(&manager); |
104 | 104 |
105 EXPECT_TRUE(InsertPath(&manager, "app_id", FPL("/foo/bar"))); | 105 EXPECT_TRUE(InsertPath(&manager, "app_id", FPL("/foo/bar"))); |
106 ErasePath(&manager, "app_id", FPL("/foo/bar")); | 106 ErasePath(&manager, "app_id", FPL("/foo/bar")); |
107 } | 107 } |
108 | 108 |
109 TEST(TaskDependencyManagerTest, PermissiveTask) { | 109 TEST(TaskDependencyManagerTest, PermissiveTask) { |
110 TaskDependencyManager manager; | 110 TaskDependencyManager manager; |
111 | 111 |
112 EXPECT_TRUE(manager.Insert(NULL)); | 112 EXPECT_TRUE(manager.Insert(nullptr)); |
113 EXPECT_TRUE(InsertPath(&manager, "app_id", FPL("/foo/bar"))); | 113 EXPECT_TRUE(InsertPath(&manager, "app_id", FPL("/foo/bar"))); |
114 EXPECT_FALSE(InsertExclusiveTask(&manager)); | 114 EXPECT_FALSE(InsertExclusiveTask(&manager)); |
115 ErasePath(&manager, "app_id", FPL("/foo/bar")); | 115 ErasePath(&manager, "app_id", FPL("/foo/bar")); |
116 | 116 |
117 EXPECT_FALSE(InsertExclusiveTask(&manager)); | 117 EXPECT_FALSE(InsertExclusiveTask(&manager)); |
118 manager.Erase(NULL); | 118 manager.Erase(nullptr); |
119 EXPECT_TRUE(InsertExclusiveTask(&manager)); | 119 EXPECT_TRUE(InsertExclusiveTask(&manager)); |
120 | 120 |
121 EXPECT_FALSE(manager.Insert(NULL)); | 121 EXPECT_FALSE(manager.Insert(nullptr)); |
122 | 122 |
123 EraseExclusiveTask(&manager); | 123 EraseExclusiveTask(&manager); |
124 } | 124 } |
125 | 125 |
126 } // namespace drive_backend | 126 } // namespace drive_backend |
127 } // namespace sync_file_system | 127 } // namespace sync_file_system |
OLD | NEW |