Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1116)

Unified Diff: chrome/browser/extensions/app_background_page_apitest.cc

Issue 10020046: Merge 131370 - Don't recreate background windows when allow_js_access if false (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/app_background_page_apitest.cc
===================================================================
--- chrome/browser/extensions/app_background_page_apitest.cc (revision 131819)
+++ chrome/browser/extensions/app_background_page_apitest.cc (working copy)
@@ -10,9 +10,11 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "content/test/test_notification_tracker.h"
#include "net/base/mock_host_resolver.h"
class AppBackgroundPageApiTest : public ExtensionApiTest {
@@ -144,6 +146,13 @@
}
IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, NoJsBackgroundPage) {
+ // Make sure that no BackgroundContentses get deleted (a signal that repeated
+ // window.open calls recreate instances, instead of being no-ops).
+ TestNotificationTracker background_deleted_tracker;
+ background_deleted_tracker.ListenFor(
+ chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED,
+ content::Source<Profile>(browser()->profile()));
+
host_resolver()->AddRule("a.com", "127.0.0.1");
ASSERT_TRUE(StartTestServer());
@@ -182,6 +191,8 @@
ASSERT_TRUE(
BackgroundContentsServiceFactory::GetForProfile(browser()->profile())->
GetAppBackgroundContents(ASCIIToUTF16(extension->id())));
+
+ EXPECT_EQ(0u, background_deleted_tracker.size());
}
IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, NoJsManifestBackgroundPage) {
« no previous file with comments | « no previous file | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698