Index: chrome/browser/apps/app_browsertest.cc |
diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc |
index ef6f3e849da338b1df61d639f7468d4768add33a..e8e0106ea13ab72d4b5e47845d0d03008e882328 100644 |
--- a/chrome/browser/apps/app_browsertest.cc |
+++ b/chrome/browser/apps/app_browsertest.cc |
@@ -1292,5 +1292,36 @@ IN_PROC_BROWSER_TEST_F(RestartDeviceTest, Restart) { |
#endif // defined(OS_CHROMEOS) |
+// Test that when an application is uninstalled and re-install it does not have |
+// access to the previously set data. |
+IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ReinstallDataCleanup) { |
+ // The application is installed and launched. After the 'Launched' message is |
+ // acknowledged by the browser process, the application will test that some |
+ // data are not installed and then install them. The application will then be |
+ // uninstalled and the same process will be repeated. |
+ ExtensionTestMessageListener launched_listener("Launched", false); |
+ const Extension* extension = |
+ LoadAndLaunchPlatformApp("reinstall_data_cleanup"); |
+ ASSERT_TRUE(extension); |
+ |
+ ExtensionApiTest::ResultCatcher result_catcher; |
+ ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
+ |
+ EXPECT_TRUE(result_catcher.GetNextResult()); |
+ |
+ UninstallExtension(extension->id()); |
+ content::RunAllPendingInMessageLoop(); |
+ |
+ { |
+ ExtensionTestMessageListener launched_listener("Launched", false); |
not at google - send to devlin
2014/01/08 02:49:17
perhaps give the first half of the test the {} sco
mlamouri (slow - plz ping)
2014/01/08 17:42:31
It does not provide much advantage but why not.
|
+ LoadAndLaunchPlatformApp("reinstall_data_cleanup"); |
not at google - send to devlin
2014/01/08 02:49:17
assert that this gets the same ID as before
mlamouri (slow - plz ping)
2014/01/08 17:42:31
OK.
|
+ |
+ ExtensionApiTest::ResultCatcher result_catcher; |
+ |
+ ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
+ |
+ EXPECT_TRUE(result_catcher.GetNextResult()); |
+ } |
+} |
} // namespace extensions |