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

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

Issue 3174023: Revert 56834 - Fix a few test failures when landing http://trac.webkit.org/ch... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/file_util.h" 5 #include "base/file_util.h"
6 #include "base/ref_counted.h" 6 #include "base/ref_counted.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/browser.h" 8 #include "chrome/browser/browser.h"
9 #include "chrome/browser/browser_list.h" 9 #include "chrome/browser/browser_list.h"
10 #include "chrome/browser/renderer_host/render_view_host.h" 10 #include "chrome/browser/renderer_host/render_view_host.h"
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 const std::string& newtab_url) { 607 const std::string& newtab_url) {
608 ui_test_utils::NavigateToURL(browser, start_url); 608 ui_test_utils::NavigateToURL(browser, start_url);
609 609
610 bool result = false; 610 bool result = false;
611 ui_test_utils::ExecuteJavaScriptAndExtractBool( 611 ui_test_utils::ExecuteJavaScriptAndExtractBool(
612 browser->GetSelectedTabContents()->render_view_host(), L"", 612 browser->GetSelectedTabContents()->render_view_host(), L"",
613 L"window.open('" + UTF8ToWide(newtab_url) + L"');" 613 L"window.open('" + UTF8ToWide(newtab_url) + L"');"
614 L"window.domAutomationController.send(true);", &result); 614 L"window.domAutomationController.send(true);", &result);
615 EXPECT_TRUE(result); 615 EXPECT_TRUE(result);
616 616
617 // Now the active tab in last active window should be the new tab. 617 // Now the current tab should be the new tab.
618 Browser* last_active_browser = BrowserList::GetLastActive(); 618 TabContents* newtab = browser->GetSelectedTabContents();
619 EXPECT_TRUE(last_active_browser);
620 TabContents* newtab = last_active_browser->GetSelectedTabContents();
621 EXPECT_TRUE(newtab);
622 GURL expected_url = start_url.Resolve(newtab_url); 619 GURL expected_url = start_url.Resolve(newtab_url);
623 if (!newtab->controller().GetLastCommittedEntry() || 620 if (!newtab->controller().GetLastCommittedEntry() ||
624 newtab->controller().GetLastCommittedEntry()->url() != expected_url) 621 newtab->controller().GetLastCommittedEntry()->url() != expected_url)
625 ui_test_utils::WaitForNavigation(&newtab->controller()); 622 ui_test_utils::WaitForNavigation(&newtab->controller());
626 EXPECT_EQ(expected_url, newtab->controller().GetLastCommittedEntry()->url()); 623 EXPECT_EQ(expected_url, newtab->controller().GetLastCommittedEntry()->url());
627 624
628 return newtab; 625 return newtab;
629 } 626 }
630 627
631 // Tests that an extension page can call window.open to an extension URL and 628 // Tests that an extension page can call window.open to an extension URL and
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 772
776 // If the options page hasn't already come up, wait for it. 773 // If the options page hasn't already come up, wait for it.
777 if (tab_strip->count() == 1) { 774 if (tab_strip->count() == 1) {
778 ui_test_utils::WaitForNewTab(browser()); 775 ui_test_utils::WaitForNewTab(browser());
779 } 776 }
780 ASSERT_EQ(2, tab_strip->count()); 777 ASSERT_EQ(2, tab_strip->count());
781 778
782 EXPECT_EQ(extension->GetResourceURL("options.html"), 779 EXPECT_EQ(extension->GetResourceURL("options.html"),
783 tab_strip->GetTabContentsAt(1)->GetURL()); 780 tab_strip->GetTabContentsAt(1)->GetURL());
784 } 781 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_process_apitest.cc ('k') | chrome/browser/history/redirect_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698