OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 "apps/launcher.h" | 5 #include "apps/launcher.h" |
6 #include "apps/shell_window.h" | 6 #include "apps/shell_window.h" |
7 #include "apps/shell_window_registry.h" | 7 #include "apps/shell_window_registry.h" |
8 #include "apps/ui/native_app_window.h" | 8 #include "apps/ui/native_app_window.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 launched_listener.Reply("restart"); | 1285 launched_listener.Reply("restart"); |
1286 ExtensionTestMessageListener restart_requested_listener("restartRequested", | 1286 ExtensionTestMessageListener restart_requested_listener("restartRequested", |
1287 false); | 1287 false); |
1288 ASSERT_TRUE(restart_requested_listener.WaitUntilSatisfied()); | 1288 ASSERT_TRUE(restart_requested_listener.WaitUntilSatisfied()); |
1289 | 1289 |
1290 EXPECT_EQ(1, request_restart_call_count()); | 1290 EXPECT_EQ(1, request_restart_call_count()); |
1291 } | 1291 } |
1292 | 1292 |
1293 #endif // defined(OS_CHROMEOS) | 1293 #endif // defined(OS_CHROMEOS) |
1294 | 1294 |
| 1295 // Test that when an application is uninstalled and re-install it does not have |
| 1296 // access to the previously set data. |
| 1297 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ReinstallDataCleanup) { |
| 1298 // The application is installed and launched. After the 'Launched' message is |
| 1299 // acknowledged by the browser process, the application will test that some |
| 1300 // data are not installed and then install them. The application will then be |
| 1301 // uninstalled and the same process will be repeated. |
| 1302 std::string extension_id; |
| 1303 |
| 1304 { |
| 1305 ExtensionTestMessageListener launched_listener("Launched", false); |
| 1306 const Extension* extension = |
| 1307 LoadAndLaunchPlatformApp("reinstall_data_cleanup"); |
| 1308 ASSERT_TRUE(extension); |
| 1309 extension_id = extension->id(); |
| 1310 |
| 1311 ExtensionApiTest::ResultCatcher result_catcher; |
| 1312 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
| 1313 |
| 1314 EXPECT_TRUE(result_catcher.GetNextResult()); |
| 1315 } |
| 1316 |
| 1317 UninstallExtension(extension_id); |
| 1318 content::RunAllPendingInMessageLoop(); |
| 1319 |
| 1320 { |
| 1321 ExtensionTestMessageListener launched_listener("Launched", false); |
| 1322 const Extension* extension = |
| 1323 LoadAndLaunchPlatformApp("reinstall_data_cleanup"); |
| 1324 ASSERT_TRUE(extension); |
| 1325 ASSERT_EQ(extension_id, extension->id()); |
| 1326 |
| 1327 ExtensionApiTest::ResultCatcher result_catcher; |
| 1328 |
| 1329 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
| 1330 |
| 1331 EXPECT_TRUE(result_catcher.GetNextResult()); |
| 1332 } |
| 1333 } |
1295 | 1334 |
1296 } // namespace extensions | 1335 } // namespace extensions |
OLD | NEW |