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

Side by Side Diff: chrome/renderer/chrome_render_frame_observer_browsertest.cc

Issue 2419723002: Move services/shell to services/service_manager (Closed)
Patch Set: rebase Created 4 years, 2 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/renderer/chrome_render_frame_observer.h" 5 #include "chrome/renderer/chrome_render_frame_observer.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 8
9 #include "base/test/histogram_tester.h" 9 #include "base/test/histogram_tester.h"
10 #include "chrome/test/base/chrome_render_view_test.h" 10 #include "chrome/test/base/chrome_render_view_test.h"
11 #include "components/translate/content/common/translate.mojom.h" 11 #include "components/translate/content/common/translate.mojom.h"
12 #include "components/translate/content/renderer/translate_helper.h" 12 #include "components/translate/content/renderer/translate_helper.h"
13 #include "components/translate/core/common/translate_constants.h" 13 #include "components/translate/core/common/translate_constants.h"
14 #include "content/public/renderer/render_frame.h" 14 #include "content/public/renderer/render_frame.h"
15 #include "content/public/renderer/render_view.h" 15 #include "content/public/renderer/render_view.h"
16 #include "mojo/public/cpp/bindings/binding_set.h" 16 #include "mojo/public/cpp/bindings/binding_set.h"
17 #include "services/shell/public/cpp/interface_provider.h" 17 #include "services/service_manager/public/cpp/interface_provider.h"
18 #include "third_party/WebKit/public/web/WebView.h" 18 #include "third_party/WebKit/public/web/WebView.h"
19 19
20 namespace { 20 namespace {
21 21
22 class FakeContentTranslateDriver 22 class FakeContentTranslateDriver
23 : public translate::mojom::ContentTranslateDriver { 23 : public translate::mojom::ContentTranslateDriver {
24 public: 24 public:
25 FakeContentTranslateDriver() 25 FakeContentTranslateDriver()
26 : called_new_page_(false), page_needs_translation_(false) {} 26 : called_new_page_(false), page_needs_translation_(false) {}
27 ~FakeContentTranslateDriver() override {} 27 ~FakeContentTranslateDriver() override {}
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 view_->GetWebView()->updateAllLifecyclePhases(); 79 view_->GetWebView()->updateAllLifecyclePhases();
80 80
81 base::RunLoop().RunUntilIdle(); 81 base::RunLoop().RunUntilIdle();
82 ASSERT_TRUE(fake_translate_driver_.called_new_page_); 82 ASSERT_TRUE(fake_translate_driver_.called_new_page_);
83 EXPECT_TRUE(fake_translate_driver_.page_needs_translation_) 83 EXPECT_TRUE(fake_translate_driver_.page_needs_translation_)
84 << "Page should be translatable."; 84 << "Page should be translatable.";
85 // Should have 2 samples: one for preliminary capture, one for final capture. 85 // Should have 2 samples: one for preliminary capture, one for final capture.
86 // If there are more, then subframes are being captured more than once. 86 // If there are more, then subframes are being captured more than once.
87 histogram_tester.ExpectTotalCount(kTranslateCaptureText, 2); 87 histogram_tester.ExpectTotalCount(kTranslateCaptureText, 2);
88 } 88 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/chrome_render_thread_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698