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