| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/apps/app_browsertest_util.h" | 5 #include "chrome/browser/apps/app_browsertest_util.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "chrome/browser/extensions/api/tabs/tabs_api.h" | 9 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
| 10 #include "chrome/browser/extensions/extension_function_test_utils.h" | 10 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 bool PlatformAppBrowserTest::RunGetWindowFunctionForExtension( | 172 bool PlatformAppBrowserTest::RunGetWindowFunctionForExtension( |
| 173 int window_id, | 173 int window_id, |
| 174 const Extension* extension) { | 174 const Extension* extension) { |
| 175 scoped_refptr<WindowsGetFunction> function = new WindowsGetFunction(); | 175 scoped_refptr<WindowsGetFunction> function = new WindowsGetFunction(); |
| 176 function->set_extension(extension); | 176 function->set_extension(extension); |
| 177 utils::RunFunction( | 177 utils::RunFunction( |
| 178 function.get(), | 178 function.get(), |
| 179 base::StringPrintf("[%u]", window_id), | 179 base::StringPrintf("[%u]", window_id), |
| 180 browser(), | 180 browser(), |
| 181 utils::NONE); | 181 utils::NONE); |
| 182 return function->GetResultList() != NULL; | 182 return *function->response_type() == ExtensionFunction::SUCCEEDED; |
| 183 } | 183 } |
| 184 | 184 |
| 185 size_t PlatformAppBrowserTest::GetAppWindowCount() { | 185 size_t PlatformAppBrowserTest::GetAppWindowCount() { |
| 186 return AppWindowRegistry::Get(browser()->profile())->app_windows().size(); | 186 return AppWindowRegistry::Get(browser()->profile())->app_windows().size(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 size_t PlatformAppBrowserTest::GetAppWindowCountForApp( | 189 size_t PlatformAppBrowserTest::GetAppWindowCountForApp( |
| 190 const std::string& app_id) { | 190 const std::string& app_id) { |
| 191 return AppWindowRegistry::Get(browser()->profile()) | 191 return AppWindowRegistry::Get(browser()->profile()) |
| 192 ->GetAppWindowsForApp(app_id) | 192 ->GetAppWindowsForApp(app_id) |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 return app_window; | 257 return app_window; |
| 258 } | 258 } |
| 259 | 259 |
| 260 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( | 260 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( |
| 261 base::CommandLine* command_line) { | 261 base::CommandLine* command_line) { |
| 262 PlatformAppBrowserTest::SetUpCommandLine(command_line); | 262 PlatformAppBrowserTest::SetUpCommandLine(command_line); |
| 263 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 263 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace extensions | 266 } // namespace extensions |
| OLD | NEW |