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

Side by Side Diff: chrome/browser/extensions/app_process_apitest.cc

Issue 2835233002: Fix integration tests in src/chrome and src/extensions so that we can turn on IO thread checks wi... (Closed)
Patch Set: ready for review Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 browser()->profile())->extension_service(); 297 browser()->profile())->extension_service();
298 extensions::ProcessMap* process_map = 298 extensions::ProcessMap* process_map =
299 extensions::ProcessMap::Get(browser()->profile()); 299 extensions::ProcessMap::Get(browser()->profile());
300 300
301 host_resolver()->AddRule("*", "127.0.0.1"); 301 host_resolver()->AddRule("*", "127.0.0.1");
302 ASSERT_TRUE(embedded_test_server()->Start()); 302 ASSERT_TRUE(embedded_test_server()->Start());
303 GURL base_url = GetTestBaseURL("app_process"); 303 GURL base_url = GetTestBaseURL("app_process");
304 304
305 // Load an app as a bookmark app. 305 // Load an app as a bookmark app.
306 std::string error; 306 std::string error;
307 scoped_refptr<const Extension> extension(extensions::file_util::LoadExtension( 307 scoped_refptr<const Extension> extension;
308 test_data_dir_.AppendASCII("app_process"), 308 {
309 extensions::Manifest::UNPACKED, 309 base::ThreadRestrictions::ScopedAllowIO allow_io;
310 Extension::FROM_BOOKMARK, 310 extension = extensions::file_util::LoadExtension(
311 &error)); 311 test_data_dir_.AppendASCII("app_process"),
312 extensions::Manifest::UNPACKED, Extension::FROM_BOOKMARK, &error);
313 }
312 service->OnExtensionInstalled(extension.get(), 314 service->OnExtensionInstalled(extension.get(),
313 syncer::StringOrdinal::CreateInitialOrdinal(), 315 syncer::StringOrdinal::CreateInitialOrdinal(),
314 extensions::kInstallFlagInstallImmediately); 316 extensions::kInstallFlagInstallImmediately);
315 ASSERT_TRUE(extension.get()); 317 ASSERT_TRUE(extension.get());
316 ASSERT_TRUE(extension->from_bookmark()); 318 ASSERT_TRUE(extension->from_bookmark());
317 319
318 // Test both opening a URL in a new tab, and opening a tab and then navigating 320 // Test both opening a URL in a new tab, and opening a tab and then navigating
319 // it. Either way, bookmark app tabs should be considered normal processes 321 // it. Either way, bookmark app tabs should be considered normal processes
320 // with no elevated privileges and no WebUI bindings. 322 // with no elevated privileges and no WebUI bindings.
321 ui_test_utils::NavigateToURLWithDisposition( 323 ui_test_utils::NavigateToURLWithDisposition(
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 // Navigate the popup to another process outside the app. 858 // Navigate the popup to another process outside the app.
857 GURL non_app_url(base_url.Resolve("path3/empty.html")); 859 GURL non_app_url(base_url.Resolve("path3/empty.html"));
858 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url); 860 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url);
859 SiteInstance* new_instance = popup_contents->GetSiteInstance(); 861 SiteInstance* new_instance = popup_contents->GetSiteInstance();
860 EXPECT_NE(app_instance, new_instance); 862 EXPECT_NE(app_instance, new_instance);
861 863
862 // It should still be in the same BrowsingInstance, allowing postMessage to 864 // It should still be in the same BrowsingInstance, allowing postMessage to
863 // work. 865 // work.
864 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance)); 866 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance));
865 } 867 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_background_page_apitest.cc ('k') | chrome/browser/extensions/content_verifier_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698