| 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 <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" |
| 11 #include "chrome/test/base/chrome_render_view_test.h" | 11 #include "chrome/test/base/chrome_render_view_test.h" |
| 12 #include "components/translate/content/common/translate.mojom.h" | 12 #include "components/translate/content/common/translate.mojom.h" |
| 13 #include "components/translate/content/renderer/translate_helper.h" | 13 #include "components/translate/content/renderer/translate_helper.h" |
| 14 #include "components/translate/core/common/translate_constants.h" | 14 #include "components/translate/core/common/translate_constants.h" |
| 15 #include "content/public/renderer/render_frame.h" | 15 #include "content/public/renderer/render_frame.h" |
| 16 #include "content/public/renderer/render_view.h" | 16 #include "content/public/renderer/render_view.h" |
| 17 #include "extensions/common/constants.h" | 17 #include "extensions/common/constants.h" |
| 18 #include "mojo/public/cpp/bindings/binding_set.h" | 18 #include "mojo/public/cpp/bindings/binding_set.h" |
| 19 #include "services/shell/public/cpp/interface_provider.h" | 19 #include "services/service_manager/public/cpp/interface_provider.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 22 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 23 | 23 |
| 24 using testing::AtLeast; | 24 using testing::AtLeast; |
| 25 using testing::Return; | 25 using testing::Return; |
| 26 using testing::_; | 26 using testing::_; |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 | 500 |
| 501 GoBack(GURL("data:text/html;charset=utf-8,<html><head>" | 501 GoBack(GURL("data:text/html;charset=utf-8,<html><head>" |
| 502 "<meta http-equiv=\"content-language\" content=\"zh\">" | 502 "<meta http-equiv=\"content-language\" content=\"zh\">" |
| 503 "</head><body>This page is in Chinese.</body></html>"), | 503 "</head><body>This page is in Chinese.</body></html>"), |
| 504 back_state); | 504 back_state); |
| 505 | 505 |
| 506 base::RunLoop().RunUntilIdle(); | 506 base::RunLoop().RunUntilIdle(); |
| 507 ASSERT_TRUE(fake_translate_driver_.called_new_page_); | 507 ASSERT_TRUE(fake_translate_driver_.called_new_page_); |
| 508 EXPECT_EQ("zh", fake_translate_driver_.details_->adopted_language); | 508 EXPECT_EQ("zh", fake_translate_driver_.details_->adopted_language); |
| 509 } | 509 } |
| OLD | NEW |