Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 845973005: [New Tab Page] Change the mechanism to intercept online NTP errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 test_extension_cache_.get()); 627 test_extension_cache_.get());
628 } 628 }
629 } 629 }
630 630
631 // Makes URLRequestMockHTTPJobs serve data from content::DIR_TEST_DATA 631 // Makes URLRequestMockHTTPJobs serve data from content::DIR_TEST_DATA
632 // instead of chrome::DIR_TEST_DATA. 632 // instead of chrome::DIR_TEST_DATA.
633 void ServeContentTestData() { 633 void ServeContentTestData() {
634 base::FilePath root_http; 634 base::FilePath root_http;
635 PathService::Get(content::DIR_TEST_DATA, &root_http); 635 PathService::Get(content::DIR_TEST_DATA, &root_http);
636 BrowserThread::PostTaskAndReply( 636 BrowserThread::PostTaskAndReply(
637 BrowserThread::IO, 637 BrowserThread::IO, FROM_HERE,
638 FROM_HERE, 638 base::Bind(URLRequestMockHTTPJob::AddUrlHandlers, root_http,
639 base::Bind(URLRequestMockHTTPJob::AddUrlHandler,
640 root_http,
641 make_scoped_refptr(BrowserThread::GetBlockingPool())), 639 make_scoped_refptr(BrowserThread::GetBlockingPool())),
642 base::MessageLoop::current()->QuitWhenIdleClosure()); 640 base::MessageLoop::current()->QuitWhenIdleClosure());
643 content::RunMessageLoop(); 641 content::RunMessageLoop();
644 } 642 }
645 643
646 void SetScreenshotPolicy(bool enabled) { 644 void SetScreenshotPolicy(bool enabled) {
647 PolicyMap policies; 645 PolicyMap policies;
648 policies.Set(key::kDisableScreenshots, 646 policies.Set(key::kDisableScreenshots,
649 POLICY_LEVEL_MANDATORY, 647 POLICY_LEVEL_MANDATORY,
650 POLICY_SCOPE_USER, 648 POLICY_SCOPE_USER,
(...skipping 2974 matching lines...) Expand 10 before | Expand all | Expand 10 after
3625 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( 3623 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
3626 browser2->tab_strip_model()->GetActiveWebContents(), 3624 browser2->tab_strip_model()->GetActiveWebContents(),
3627 "domAutomationController.send(window.showModalDialog !== undefined);", 3625 "domAutomationController.send(window.showModalDialog !== undefined);",
3628 &result)); 3626 &result));
3629 EXPECT_TRUE(result); 3627 EXPECT_TRUE(result);
3630 } 3628 }
3631 3629
3632 #endif // !defined(CHROME_OS) 3630 #endif // !defined(CHROME_OS)
3633 3631
3634 } // namespace policy 3632 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698