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

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

Issue 12803011: Add BaseWindow::GetContentBounds() and use in WindowController::CreateWindowValue() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix osx build Created 7 years, 9 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
« no previous file with comments | « chrome/browser/extensions/window_controller.cc ('k') | chrome/browser/ui/base_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/memory/scoped_vector.h" 6 #include "base/memory/scoped_vector.h"
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/browser/extensions/extension_host.h" 9 #include "chrome/browser/extensions/extension_host.h"
10 #include "chrome/browser/extensions/extension_process_manager.h" 10 #include "chrome/browser/extensions/extension_process_manager.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 // Expect one panel (opened by extension) and one tab (from the panel calling 395 // Expect one panel (opened by extension) and one tab (from the panel calling
396 // window.open). Panels modify the WindowOpenDisposition in window.open 396 // window.open). Panels modify the WindowOpenDisposition in window.open
397 // to always open in a tab. 397 // to always open in a tab.
398 EXPECT_TRUE(WaitForTabsAndPopups(browser(), 1, 0, 1)); 398 EXPECT_TRUE(WaitForTabsAndPopups(browser(), 1, 0, 1));
399 } 399 }
400 400
401 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpener) { 401 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpener) {
402 ASSERT_TRUE(RunExtensionTest("window_open/opener")) << message_; 402 ASSERT_TRUE(RunExtensionTest("window_open/opener")) << message_;
403 } 403 }
404 404
405 // Ensure that the width and height properties of a window opened with
406 // chrome.windows.create match the creation parameters. See crbug.com/173831.
407 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowOpenSized) {
408 ASSERT_TRUE(RunExtensionTest("window_open/window_size")) << message_;
409 EXPECT_TRUE(WaitForTabsAndPopups(browser(), 0, 1, 0));
410 }
411
405 // Tests that an extension page can call window.open to an extension URL and 412 // Tests that an extension page can call window.open to an extension URL and
406 // the new window has extension privileges. 413 // the new window has extension privileges.
407 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WindowOpenExtension) { 414 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WindowOpenExtension) {
408 ASSERT_TRUE(LoadExtension( 415 ASSERT_TRUE(LoadExtension(
409 test_data_dir_.AppendASCII("uitest").AppendASCII("window_open"))); 416 test_data_dir_.AppendASCII("uitest").AppendASCII("window_open")));
410 417
411 GURL start_url(std::string("chrome-extension://") + 418 GURL start_url(std::string("chrome-extension://") +
412 last_loaded_extension_id_ + "/test.html"); 419 last_loaded_extension_id_ + "/test.html");
413 ui_test_utils::NavigateToURL(browser(), start_url); 420 ui_test_utils::NavigateToURL(browser(), start_url);
414 WebContents* newtab = NULL; 421 WebContents* newtab = NULL;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 OpenWindow(browser()->tab_strip_model()->GetActiveWebContents(), 460 OpenWindow(browser()->tab_strip_model()->GetActiveWebContents(),
454 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + 461 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ +
455 "/newtab.html"), false, &newtab)); 462 "/newtab.html"), false, &newtab));
456 463
457 // Extension API should succeed. 464 // Extension API should succeed.
458 bool result = false; 465 bool result = false;
459 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", 466 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()",
460 &result)); 467 &result));
461 EXPECT_TRUE(result); 468 EXPECT_TRUE(result);
462 } 469 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/window_controller.cc ('k') | chrome/browser/ui/base_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698