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

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

Issue 10822030: Move ui_test_utils::RunMessageLoop to test_utils so that it can be reused by content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
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 "chrome/browser/extensions/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 #include "chrome/browser/extensions/extension_host.h" 6 #include "chrome/browser/extensions/extension_host.h"
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/extensions/process_map.h" 8 #include "chrome/browser/extensions/process_map.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 488
489 // Load the launcher extension, which should launch the app. 489 // Load the launcher extension, which should launch the app.
490 ui_test_utils::NavigateToURLWithDisposition( 490 ui_test_utils::NavigateToURLWithDisposition(
491 browser(), 491 browser(),
492 launcher->GetResourceURL("main.html"), 492 launcher->GetResourceURL("main.html"),
493 CURRENT_TAB, 493 CURRENT_TAB,
494 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 494 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
495 495
496 // Wait for app tab to be created and loaded. 496 // Wait for app tab to be created and loaded.
497 test_navigation_observer.WaitForObservation( 497 test_navigation_observer.WaitForObservation(
498 base::Bind(&ui_test_utils::RunMessageLoop), 498 base::Bind(&content::RunMessageLoop),
499 base::Bind(&MessageLoop::Quit, 499 base::Bind(&MessageLoop::Quit,
500 base::Unretained(MessageLoopForUI::current()))); 500 base::Unretained(MessageLoopForUI::current())));
501 501
502 // App has loaded, and chrome.app.isInstalled should be true. 502 // App has loaded, and chrome.app.isInstalled should be true.
503 bool is_installed = false; 503 bool is_installed = false;
504 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( 504 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
505 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"", 505 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"",
506 L"window.domAutomationController.send(chrome.app.isInstalled)", 506 L"window.domAutomationController.send(chrome.app.isInstalled)",
507 &is_installed)); 507 &is_installed));
508 ASSERT_TRUE(is_installed); 508 ASSERT_TRUE(is_installed);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 content::Source<NavigationController>( 583 content::Source<NavigationController>(
584 &chrome::GetActiveWebContents(browser())->GetController())); 584 &chrome::GetActiveWebContents(browser())->GetController()));
585 chrome::Reload(browser(), CURRENT_TAB); 585 chrome::Reload(browser(), CURRENT_TAB);
586 observer.Wait(); 586 observer.Wait();
587 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( 587 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
588 contents->GetRenderViewHost(), L"", 588 contents->GetRenderViewHost(), L"",
589 L"window.domAutomationController.send(chrome.app.isInstalled)", 589 L"window.domAutomationController.send(chrome.app.isInstalled)",
590 &is_installed)); 590 &is_installed));
591 ASSERT_TRUE(is_installed); 591 ASSERT_TRUE(is_installed);
592 } 592 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_notification_browsertest.cc ('k') | chrome/browser/extensions/convert_web_app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698