OLD | NEW |
---|---|
(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 "chrome/browser/apps/app_browsertest_util.h" | |
6 #include "chrome/browser/extensions/extension_test_message_listener.h" | |
7 | |
8 using namespace apps; | |
9 | |
10 namespace extensions { | |
benwells
2013/10/29 21:22:34
no namespace here. we have some clear but not-alwa
| |
11 | |
12 // This class of BrowserTests is a helper to create tests related to crashes in | |
13 // Chrome Apps. To be tested, the app will have to be placed as any other test | |
14 // app (see PlatformAppBrowserTest) and will need to send a "Done" message back. | |
15 // When the "Done" message is received, the test succeed. If it is not, it is | |
16 // assumed that Chrome has crashed and the test will anyway fail. | |
17 // | |
18 // The entry in this file should be something like: | |
19 // IN_PROC_BROWSER_TEST_F(AppCrashTest, <TEST_NAME>) { | |
20 // ASSERT_TRUE(RunAppCrashTest("<DIRECTORY_TEST_NAME>")); | |
21 // } | |
22 | |
23 class AppCrashTest : public PlatformAppBrowserTest { | |
24 public: | |
25 bool RunAppCrashTest(const char* name) { | |
26 ExtensionTestMessageListener listener("Done", false); | |
27 LoadAndLaunchPlatformApp(name); | |
28 return listener.WaitUntilSatisfied(); | |
29 } | |
30 }; | |
31 | |
32 IN_PROC_BROWSER_TEST_F(AppCrashTest, HiddenWindows) { | |
33 ASSERT_TRUE(RunAppCrashTest("crashtest_hidden_windows")); | |
34 } | |
35 | |
36 } // namespace extensions | |
OLD | NEW |