OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer_context_menu/render_view_context_menu.h" | 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ptr_util.h" |
16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
17 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
18 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
19 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
20 #include "build/build_config.h" | 21 #include "build/build_config.h" |
21 #include "chrome/app/chrome_command_ids.h" | 22 #include "chrome/app/chrome_command_ids.h" |
22 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
23 #include "chrome/browser/chrome_notification_types.h" | 24 #include "chrome/browser/chrome_notification_types.h" |
24 #include "chrome/browser/profiles/profile_attributes_entry.h" | 25 #include "chrome/browser/profiles/profile_attributes_entry.h" |
25 #include "chrome/browser/profiles/profile_attributes_storage.h" | 26 #include "chrome/browser/profiles/profile_attributes_storage.h" |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 search_test_utils::WaitForTemplateURLServiceToLoad(model); | 676 search_test_utils::WaitForTemplateURLServiceToLoad(model); |
676 ASSERT_TRUE(model->loaded()); | 677 ASSERT_TRUE(model->loaded()); |
677 | 678 |
678 TemplateURLData data; | 679 TemplateURLData data; |
679 data.SetShortName(base::ASCIIToUTF16(kShortName)); | 680 data.SetShortName(base::ASCIIToUTF16(kShortName)); |
680 data.SetKeyword(data.short_name()); | 681 data.SetKeyword(data.short_name()); |
681 data.SetURL(embedded_test_server()->GetURL(kSearchURL).spec()); | 682 data.SetURL(embedded_test_server()->GetURL(kSearchURL).spec()); |
682 data.image_url = GetImageSearchURL().spec(); | 683 data.image_url = GetImageSearchURL().spec(); |
683 data.image_url_post_params = kImageSearchPostParams; | 684 data.image_url_post_params = kImageSearchPostParams; |
684 | 685 |
685 // The model takes ownership of |template_url|. | 686 TemplateURL* template_url = model->Add(base::MakeUnique<TemplateURL>(data)); |
686 TemplateURL* template_url = new TemplateURL(data); | 687 ASSERT_TRUE(template_url); |
687 ASSERT_TRUE(model->Add(template_url)); | |
688 model->SetUserSelectedDefaultSearchProvider(template_url); | 688 model->SetUserSelectedDefaultSearchProvider(template_url); |
689 } | 689 } |
690 | 690 |
691 void TearDownInProcessBrowserTestFixture() override { | 691 void TearDownInProcessBrowserTestFixture() override { |
692 menu_observer_.reset(); | 692 menu_observer_.reset(); |
693 } | 693 } |
694 | 694 |
695 std::unique_ptr<ContextMenuNotificationObserver> menu_observer_; | 695 std::unique_ptr<ContextMenuNotificationObserver> menu_observer_; |
696 }; | 696 }; |
697 | 697 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 IN_PROC_BROWSER_TEST_F(LoadImageBrowserTest, LoadImage) { | 841 IN_PROC_BROWSER_TEST_F(LoadImageBrowserTest, LoadImage) { |
842 static const char kValidImage[] = "/load_image/image.png"; | 842 static const char kValidImage[] = "/load_image/image.png"; |
843 SetupAndLoadImagePage(kValidImage); | 843 SetupAndLoadImagePage(kValidImage); |
844 AddLoadImageInterceptor(kValidImage); | 844 AddLoadImageInterceptor(kValidImage); |
845 AttemptLoadImage(); | 845 AttemptLoadImage(); |
846 interceptor_->WaitForRequests(1); | 846 interceptor_->WaitForRequests(1); |
847 EXPECT_EQ(1, interceptor_->num_requests()); | 847 EXPECT_EQ(1, interceptor_->num_requests()); |
848 } | 848 } |
849 | 849 |
850 } // namespace | 850 } // namespace |
OLD | NEW |