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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 CommandLine::ForCurrentProcess()->AppendSwitch("noerrdialogs"); | 604 CommandLine::ForCurrentProcess()->AppendSwitch("noerrdialogs"); |
605 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 605 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
606 .WillRepeatedly(Return(true)); | 606 .WillRepeatedly(Return(true)); |
607 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 607 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
608 } | 608 } |
609 | 609 |
610 virtual void SetUpOnMainThread() override { | 610 virtual void SetUpOnMainThread() override { |
611 BrowserThread::PostTask( | 611 BrowserThread::PostTask( |
612 BrowserThread::IO, FROM_HERE, | 612 BrowserThread::IO, FROM_HERE, |
613 base::Bind(chrome_browser_net::SetUrlRequestMocksEnabled, true)); | 613 base::Bind(chrome_browser_net::SetUrlRequestMocksEnabled, true)); |
| 614 if (extension_service()->updater()) { |
| 615 extension_service()->updater()->SetExtensionCacheForTesting( |
| 616 test_extension_cache_.get()); |
| 617 } |
614 } | 618 } |
615 | 619 |
616 // Makes URLRequestMockHTTPJobs serve data from content::DIR_TEST_DATA | 620 // Makes URLRequestMockHTTPJobs serve data from content::DIR_TEST_DATA |
617 // instead of chrome::DIR_TEST_DATA. | 621 // instead of chrome::DIR_TEST_DATA. |
618 void ServeContentTestData() { | 622 void ServeContentTestData() { |
619 base::FilePath root_http; | 623 base::FilePath root_http; |
620 PathService::Get(content::DIR_TEST_DATA, &root_http); | 624 PathService::Get(content::DIR_TEST_DATA, &root_http); |
621 BrowserThread::PostTaskAndReply( | 625 BrowserThread::PostTaskAndReply( |
622 BrowserThread::IO, | 626 BrowserThread::IO, |
623 FROM_HERE, | 627 FROM_HERE, |
(...skipping 2608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3232 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3236 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
3233 browser2->tab_strip_model()->GetActiveWebContents(), | 3237 browser2->tab_strip_model()->GetActiveWebContents(), |
3234 "domAutomationController.send(window.showModalDialog !== undefined);", | 3238 "domAutomationController.send(window.showModalDialog !== undefined);", |
3235 &result)); | 3239 &result)); |
3236 EXPECT_TRUE(result); | 3240 EXPECT_TRUE(result); |
3237 } | 3241 } |
3238 | 3242 |
3239 #endif // !defined(CHROME_OS) | 3243 #endif // !defined(CHROME_OS) |
3240 | 3244 |
3241 } // namespace policy | 3245 } // namespace policy |
OLD | NEW |