Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / extensions / shell / test / shell_apitest.h
blob2246b49bbeb853bb2d15dc2f7fcf6f997a181e21
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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_SHELL_TEST_SHELL_APITEST_H_
6 #define EXTENSIONS_SHELL_TEST_SHELL_APITEST_H_
8 #include <string>
10 #include "extensions/shell/test/shell_test.h"
12 namespace extensions {
14 class Extension;
16 // Base class for app shell browser API tests that load an app/extension
17 // and wait for a success message from the chrome.test API.
18 class ShellApiTest : public AppShellTest {
19 public:
20 ShellApiTest();
21 ~ShellApiTest() override;
23 // Load and run an unpacked platform app from the |app_dir| directory. Unlike
24 // |RunAppTest|, it won't wait automatically for any kind of notification.
25 // Returns an instance of the extension that was just loaded.
26 const Extension* LoadApp(const std::string& app_dir);
28 // Loads an unpacked platform app from a directory using the current
29 // ExtensionSystem, launches it, and waits for a chrome.test success
30 // notification. Returns true if the test succeeds. |app_dir| is a
31 // subpath under extensions/test/data.
32 bool RunAppTest(const std::string& app_dir);
34 // Removes the |app| from the ExtensionRegistry and dispatches
35 // notifications of the removal stating reason as REASON_DISABLE.
36 void UnloadApp(const Extension* app);
38 protected:
39 // If it failed, what was the error message?
40 std::string message_;
42 private:
43 DISALLOW_COPY_AND_ASSIGN(ShellApiTest);
46 } // namespace extensions
48 #endif // EXTENSIONS_SHELL_TEST_SHELL_APITEST_H_