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

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

Issue 494033002: Move AppWindow to extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unneeded include in chrome_shell_delegate.cc Created 6 years, 3 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 "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/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/extensions/extension_test_message_listener.h" 10 #include "chrome/browser/extensions/extension_test_message_listener.h"
(...skipping 16 matching lines...) Expand all
27 #include "extensions/browser/extension_system.h" 27 #include "extensions/browser/extension_system.h"
28 #include "extensions/browser/process_manager.h" 28 #include "extensions/browser/process_manager.h"
29 #include "extensions/common/constants.h" 29 #include "extensions/common/constants.h"
30 #include "extensions/common/extension.h" 30 #include "extensions/common/extension.h"
31 #include "extensions/common/switches.h" 31 #include "extensions/common/switches.h"
32 #include "net/dns/mock_host_resolver.h" 32 #include "net/dns/mock_host_resolver.h"
33 #include "net/test/embedded_test_server/embedded_test_server.h" 33 #include "net/test/embedded_test_server/embedded_test_server.h"
34 #include "testing/gtest/include/gtest/gtest.h" 34 #include "testing/gtest/include/gtest/gtest.h"
35 35
36 #if defined(USE_ASH) 36 #if defined(USE_ASH)
37 #include "apps/app_window_registry.h" 37 #include "extensions/browser/app_window/app_window_registry.h"
38 #endif 38 #endif
39 39
40 #if defined(USE_ASH) && defined(OS_CHROMEOS) 40 #if defined(USE_ASH) && defined(OS_CHROMEOS)
41 // TODO(stevenjb): Figure out the correct behavior for Ash + Win 41 // TODO(stevenjb): Figure out the correct behavior for Ash + Win
42 #define USE_ASH_PANELS 42 #define USE_ASH_PANELS
43 #endif 43 #endif
44 44
45 using content::OpenURLParams; 45 using content::OpenURLParams;
46 using content::Referrer; 46 using content::Referrer;
47 using content::WebContents; 47 using content::WebContents;
48 48
49 // Disabled, http://crbug.com/64899. 49 // Disabled, http://crbug.com/64899.
50 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpen) { 50 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpen) {
51 CommandLine::ForCurrentProcess()->AppendSwitch( 51 CommandLine::ForCurrentProcess()->AppendSwitch(
52 extensions::switches::kEnableExperimentalExtensionApis); 52 extensions::switches::kEnableExperimentalExtensionApis);
53 53
54 ResultCatcher catcher; 54 ResultCatcher catcher;
55 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ 55 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_
56 .AppendASCII("window_open").AppendASCII("spanning"))); 56 .AppendASCII("window_open").AppendASCII("spanning")));
57 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 57 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
58 } 58 }
59 59
60 int GetPanelCount(Browser* browser) { 60 int GetPanelCount(Browser* browser) {
61 #if defined(USE_ASH_PANELS) 61 #if defined(USE_ASH_PANELS)
62 return static_cast<int>( 62 return static_cast<int>(extensions::AppWindowRegistry::Get(
63 apps::AppWindowRegistry::Get(browser->profile())->app_windows().size()); 63 browser->profile())->app_windows().size());
64 #else 64 #else
65 return PanelManager::GetInstance()->num_panels(); 65 return PanelManager::GetInstance()->num_panels();
66 #endif 66 #endif
67 } 67 }
68 68
69 bool WaitForTabsAndPopups(Browser* browser, 69 bool WaitForTabsAndPopups(Browser* browser,
70 int num_tabs, 70 int num_tabs,
71 int num_popups, 71 int num_popups,
72 int num_panels) { 72 int num_panels) {
73 SCOPED_TRACE( 73 SCOPED_TRACE(
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 last_loaded_extension_id() + "/newtab.html"), 503 last_loaded_extension_id() + "/newtab.html"),
504 false, 504 false,
505 &newtab)); 505 &newtab));
506 506
507 // Extension API should succeed. 507 // Extension API should succeed.
508 bool result = false; 508 bool result = false;
509 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", 509 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()",
510 &result)); 510 &result));
511 EXPECT_TRUE(result); 511 EXPECT_TRUE(result);
512 } 512 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/startup_helper.cc ('k') | chrome/browser/media/media_capture_devices_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698