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

Side by Side Diff: chrome/renderer/translate/translate_helper_browsertest.cc

Issue 2628053003: Remove extension group from DOMWrapperWorld. (Closed)
Patch Set: Fix GCCallbackTest Created 3 years, 11 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 <tuple> 5 #include <tuple>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/common/chrome_isolated_world_ids.h" 10 #include "chrome/common/chrome_isolated_world_ids.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 mojo::BindingSet<translate::mojom::ContentTranslateDriver> bindings_; 63 mojo::BindingSet<translate::mojom::ContentTranslateDriver> bindings_;
64 }; 64 };
65 65
66 } // namespace 66 } // namespace
67 67
68 class TestTranslateHelper : public translate::TranslateHelper { 68 class TestTranslateHelper : public translate::TranslateHelper {
69 public: 69 public:
70 explicit TestTranslateHelper(content::RenderFrame* render_frame) 70 explicit TestTranslateHelper(content::RenderFrame* render_frame)
71 : translate::TranslateHelper(render_frame, 71 : translate::TranslateHelper(render_frame,
72 chrome::ISOLATED_WORLD_ID_TRANSLATE, 72 chrome::ISOLATED_WORLD_ID_TRANSLATE,
73 0,
74 extensions::kExtensionScheme) {} 73 extensions::kExtensionScheme) {}
75 74
76 base::TimeDelta AdjustDelay(int delayInMs) override { 75 base::TimeDelta AdjustDelay(int delayInMs) override {
77 // Just returns base::TimeDelta() which has initial value 0. 76 // Just returns base::TimeDelta() which has initial value 0.
78 // Tasks doesn't need to be delayed in tests. 77 // Tasks doesn't need to be delayed in tests.
79 return base::TimeDelta(); 78 return base::TimeDelta();
80 } 79 }
81 80
82 void TranslatePage(const std::string& source_lang, 81 void TranslatePage(const std::string& source_lang,
83 const std::string& target_lang, 82 const std::string& target_lang,
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 499
501 GoBack(GURL("data:text/html;charset=utf-8,<html><head>" 500 GoBack(GURL("data:text/html;charset=utf-8,<html><head>"
502 "<meta http-equiv=\"content-language\" content=\"zh\">" 501 "<meta http-equiv=\"content-language\" content=\"zh\">"
503 "</head><body>This page is in Chinese.</body></html>"), 502 "</head><body>This page is in Chinese.</body></html>"),
504 back_state); 503 back_state);
505 504
506 base::RunLoop().RunUntilIdle(); 505 base::RunLoop().RunUntilIdle();
507 ASSERT_TRUE(fake_translate_driver_.called_new_page_); 506 ASSERT_TRUE(fake_translate_driver_.called_new_page_);
508 EXPECT_EQ("zh", fake_translate_driver_.details_->adopted_language); 507 EXPECT_EQ("zh", fake_translate_driver_.details_->adopted_language);
509 } 508 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698