| 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 "base/bind.h" | 5 #include "base/bind.h" | 
| 6 #include "base/test/test_timeouts.h" | 6 #include "base/test/test_timeouts.h" | 
| 7 #include "base/threading/platform_thread.h" | 7 #include "base/threading/platform_thread.h" | 
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" | 
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" | 
| 10 #include "chrome/browser/automation/automation_util.h" | 10 #include "chrome/browser/automation/automation_util.h" | 
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 520   params.command_line = CommandLine::ForCurrentProcess(); | 520   params.command_line = CommandLine::ForCurrentProcess(); | 
| 521   params.current_directory = test_data_dir_; | 521   params.current_directory = test_data_dir_; | 
| 522   application_launch::OpenApplication(params); | 522   application_launch::OpenApplication(params); | 
| 523 | 523 | 
| 524   if (!catcher.GetNextResult()) { | 524   if (!catcher.GetNextResult()) { | 
| 525     message_ = catcher.message(); | 525     message_ = catcher.message(); | 
| 526     ASSERT_TRUE(0); | 526     ASSERT_TRUE(0); | 
| 527   } | 527   } | 
| 528 } | 528 } | 
| 529 | 529 | 
| 530 // Tests that no launch data is sent through if the platform app provides |  | 
| 531 // an intent with the wrong action. |  | 
| 532 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithWrongIntent) { |  | 
| 533   SetCommandLineArg(kTestFilePath); |  | 
| 534   ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_wrong_intent")) |  | 
| 535       << message_; |  | 
| 536 } |  | 
| 537 |  | 
| 538 // Tests that no launch data is sent through if the file is of the wrong MIME | 530 // Tests that no launch data is sent through if the file is of the wrong MIME | 
| 539 // type. | 531 // type. | 
| 540 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithWrongType) { | 532 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithWrongType) { | 
| 541   SetCommandLineArg(kTestFilePath); | 533   SetCommandLineArg(kTestFilePath); | 
| 542   ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_wrong_type")) | 534   ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_wrong_type")) | 
| 543       << message_; | 535       << message_; | 
| 544 } | 536 } | 
| 545 | 537 | 
| 546 // Tests that no launch data is sent through if the platform app does not | 538 // Tests that no launch data is sent through if the platform app does not | 
| 547 // provide an intent. | 539 // provide an intent. | 
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 754   window = GetFirstShellWindow(); | 746   window = GetFirstShellWindow(); | 
| 755   ASSERT_TRUE(window); | 747   ASSERT_TRUE(window); | 
| 756 | 748 | 
| 757   // DevTools should have reopened with the relaunch. | 749   // DevTools should have reopened with the relaunch. | 
| 758   rvh = window->web_contents()->GetRenderViewHost(); | 750   rvh = window->web_contents()->GetRenderViewHost(); | 
| 759   ASSERT_TRUE(rvh); | 751   ASSERT_TRUE(rvh); | 
| 760   ASSERT_TRUE(DevToolsAgentHostRegistry::HasDevToolsAgentHost(rvh)); | 752   ASSERT_TRUE(DevToolsAgentHostRegistry::HasDevToolsAgentHost(rvh)); | 
| 761 } | 753 } | 
| 762 | 754 | 
| 763 }  // namespace extensions | 755 }  // namespace extensions | 
| OLD | NEW | 
|---|