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..6e2bb4928a1dfd816a7e56ddeb47265fc3147029 100644 |
--- a/chrome/browser/apps/app_browsertest.cc |
+++ b/chrome/browser/apps/app_browsertest.cc |
@@ -1292,5 +1292,44 @@ 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. |
+ std::string extension_id; |
+ |
+ { |
+ ExtensionTestMessageListener launched_listener("Launched", false); |
+ const Extension* extension = |
+ LoadAndLaunchPlatformApp("reinstall_data_cleanup"); |
+ ASSERT_TRUE(extension); |
+ extension_id = extension->id(); |
+ |
+ ExtensionApiTest::ResultCatcher result_catcher; |
+ ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
+ |
+ EXPECT_TRUE(result_catcher.GetNextResult()); |
+ } |
+ |
+ UninstallExtension(extension_id); |
+ content::RunAllPendingInMessageLoop(); |
+ |
+ { |
+ ExtensionTestMessageListener launched_listener("Launched", false); |
+ const Extension* reloaded_extension = |
not at google - send to devlin
2014/01/08 18:01:36
might as well call this "extension"?
mlamouri (slow - plz ping)
2014/01/08 23:44:08
Indeed. I did the scoping of the other block after
|
+ LoadAndLaunchPlatformApp("reinstall_data_cleanup"); |
+ ASSERT_TRUE(reloaded_extension); |
+ ASSERT_EQ(reloaded_extension->id(), extension_id); |
not at google - send to devlin
2014/01/08 18:01:36
nit: expected value should be 1st argument.
mlamouri (slow - plz ping)
2014/01/08 23:44:08
Done. But it's not that intuitive given that the c
not at google - send to devlin
2014/01/08 23:59:53
It's just one of those things: https://code.google
|
+ |
+ ExtensionApiTest::ResultCatcher result_catcher; |
+ |
+ ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
+ |
+ EXPECT_TRUE(result_catcher.GetNextResult()); |
+ } |
+} |
} // namespace extensions |