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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 10 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 } | 76 } |
77 #elif defined(OS_MACOSX) | 77 #elif defined(OS_MACOSX) |
78 base::FilePath plugin_dir; | 78 base::FilePath plugin_dir; |
79 PathService::Get(base::DIR_MODULE, &plugin_dir); | 79 PathService::Get(base::DIR_MODULE, &plugin_dir); |
80 plugin_dir = plugin_dir.AppendASCII("plugins"); | 80 plugin_dir = plugin_dir.AppendASCII("plugins"); |
81 // The plugins directory isn't read by default on the Mac, so it needs to be | 81 // The plugins directory isn't read by default on the Mac, so it needs to be |
82 // explicitly registered. | 82 // explicitly registered. |
83 command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir); | 83 command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir); |
84 #endif | 84 #endif |
85 command_line->AppendSwitch(switches::kEnableNpapi); | 85 command_line->AppendSwitch(switches::kEnableNpapiForTesting); |
86 } | 86 } |
87 | 87 |
88 void SetUpOnMainThread() override { | 88 void SetUpOnMainThread() override { |
89 base::FilePath path = GetTestFilePath("", ""); | 89 base::FilePath path = GetTestFilePath("", ""); |
90 BrowserThread::PostTask( | 90 BrowserThread::PostTask( |
91 BrowserThread::IO, FROM_HERE, base::Bind(&SetUrlRequestMock, path)); | 91 BrowserThread::IO, FROM_HERE, base::Bind(&SetUrlRequestMock, path)); |
92 } | 92 } |
93 | 93 |
94 static void LoadAndWaitInWindow(Shell* window, const GURL& url) { | 94 static void LoadAndWaitInWindow(Shell* window, const GURL& url) { |
95 base::string16 expected_title(ASCIIToUTF16("OK")); | 95 base::string16 expected_title(ASCIIToUTF16("OK")); |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 ResourceDispatcherHostDelegate* old_delegate = | 570 ResourceDispatcherHostDelegate* old_delegate = |
571 ResourceDispatcherHostImpl::Get()->delegate(); | 571 ResourceDispatcherHostImpl::Get()->delegate(); |
572 ResourceDispatcherHostImpl::Get()->SetDelegate(&test_delegate); | 572 ResourceDispatcherHostImpl::Get()->SetDelegate(&test_delegate); |
573 LoadAndWait(url); | 573 LoadAndWait(url); |
574 test_delegate.WaitForPluginRequest(); | 574 test_delegate.WaitForPluginRequest(); |
575 ASSERT_TRUE(test_delegate.found_cookie()); | 575 ASSERT_TRUE(test_delegate.found_cookie()); |
576 ResourceDispatcherHostImpl::Get()->SetDelegate(old_delegate); | 576 ResourceDispatcherHostImpl::Get()->SetDelegate(old_delegate); |
577 } | 577 } |
578 | 578 |
579 } // namespace content | 579 } // namespace content |
OLD | NEW |