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

Side by Side Diff: content/public/test/test_fileapi_operation_waiter.h

Issue 2398463004: browser_test that creates filesystem resources in extension origin (Closed)
Patch Set: Rebase & apply alex's fixes. Created 4 years 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
OLDNEW
(Empty)
1 // Copyright 2016 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 #ifndef CONTENT_PUBLIC_TEST_TEST_FILEAPI_OPERATION_WAITER_H_
6
7 #include <stdint.h>
8
9 #include "base/compiler_specific.h"
10 #include "base/macros.h"
11 #include "base/run_loop.h"
12 #include "storage/browser/fileapi/file_observers.h"
13
14 namespace storage {
15 class FileSystemContext;
16 class FileSystemURL;
17 }
18
19 namespace content {
20
21 // Installs a temporary storage::FileUpdateObserver for use in browser tests
22 // that need to wait for a specific fileapi operation to complete.
23 class TestFileapiOperationWaiter : public storage::FileUpdateObserver {
24 public:
25 explicit TestFileapiOperationWaiter(storage::FileSystemContext* context);
26 ~TestFileapiOperationWaiter() override;
27
28 // Returns true if OnStartUpdate has occurred.
29 bool did_start_update() { return did_start_update_; }
30
31 // Wait for the next OnEndUpdate event.
32 void WaitForEndUpdate();
33
34 // FileUpdateObserver overrides.
35 void OnStartUpdate(const storage::FileSystemURL& url) override;
36 void OnUpdate(const storage::FileSystemURL& url, int64_t delta) override;
37 void OnEndUpdate(const storage::FileSystemURL& url) override;
38
39 private:
40 bool did_start_update_ = false;
41 base::RunLoop run_loop_;
42
43 DISALLOW_COPY_AND_ASSIGN(TestFileapiOperationWaiter);
44 };
45
46 } // namespace content
47
48 #endif // CONTENT_PUBLIC_TEST_TEST_FILEAPI_OPERATION_WAITER_H_
OLDNEW
« no previous file with comments | « content/public/test/browser_test_utils.cc ('k') | content/public/test/test_fileapi_operation_waiter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698