OLD | NEW |
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 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // may lack a scheme & host and thus be a relative url within the loaded | 310 // may lack a scheme & host and thus be a relative url within the loaded |
311 // extension. | 311 // extension. |
312 if (!url.is_valid()) { | 312 if (!url.is_valid()) { |
313 DCHECK(!extension_name.empty()) << | 313 DCHECK(!extension_name.empty()) << |
314 "Relative page_url given with no extension_name"; | 314 "Relative page_url given with no extension_name"; |
315 | 315 |
316 url = extension->GetResourceURL(page_url); | 316 url = extension->GetResourceURL(page_url); |
317 } | 317 } |
318 | 318 |
319 if (use_incognito) | 319 if (use_incognito) |
320 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), url); | 320 OpenURLOffTheRecord(browser()->profile(), url); |
321 else | 321 else |
322 ui_test_utils::NavigateToURL(browser(), url); | 322 ui_test_utils::NavigateToURL(browser(), url); |
323 } else if (launch_platform_app) { | 323 } else if (launch_platform_app) { |
324 AppLaunchParams params(browser()->profile(), extension, | 324 AppLaunchParams params(browser()->profile(), extension, |
325 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, | 325 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, |
326 extensions::SOURCE_TEST); | 326 extensions::SOURCE_TEST); |
327 params.command_line = *base::CommandLine::ForCurrentProcess(); | 327 params.command_line = *base::CommandLine::ForCurrentProcess(); |
328 OpenApplication(params); | 328 OpenApplication(params); |
329 } | 329 } |
330 | 330 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 } | 425 } |
426 | 426 |
427 void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) { | 427 void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) { |
428 ExtensionBrowserTest::SetUpCommandLine(command_line); | 428 ExtensionBrowserTest::SetUpCommandLine(command_line); |
429 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); | 429 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); |
430 // Backgrounded renderer processes run at a lower priority, causing the | 430 // Backgrounded renderer processes run at a lower priority, causing the |
431 // tests to take more time to complete. Disable backgrounding so that the | 431 // tests to take more time to complete. Disable backgrounding so that the |
432 // tests don't time out. | 432 // tests don't time out. |
433 command_line->AppendSwitch(switches::kDisableRendererBackgrounding); | 433 command_line->AppendSwitch(switches::kDisableRendererBackgrounding); |
434 } | 434 } |
OLD | NEW |