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 #import "components/translate/ios/browser/translate_controller.h" | 5 #import "components/translate/ios/browser/translate_controller.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #import "components/translate/ios/browser/js_translate_manager.h" | 10 #import "components/translate/ios/browser/js_translate_manager.h" |
11 #include "ios/web/public/test/test_web_state.h" | 11 #import "ios/web/public/test/fakes/test_web_state.h" |
12 #include "testing/platform_test.h" | 12 #include "testing/platform_test.h" |
13 #import "third_party/ocmock/OCMock/OCMock.h" | 13 #import "third_party/ocmock/OCMock/OCMock.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace translate { | 16 namespace translate { |
17 | 17 |
18 class TranslateControllerTest : public PlatformTest, | 18 class TranslateControllerTest : public PlatformTest, |
19 public TranslateController::Observer { | 19 public TranslateController::Observer { |
20 protected: | 20 protected: |
21 TranslateControllerTest() | 21 TranslateControllerTest() |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 command.SetString("command", "translate.status"); | 135 command.SetString("command", "translate.status"); |
136 command.SetBoolean("success", false); | 136 command.SetBoolean("success", false); |
137 EXPECT_TRUE(translate_controller_->OnJavascriptCommandReceived( | 137 EXPECT_TRUE(translate_controller_->OnJavascriptCommandReceived( |
138 command, GURL("http://google.com"), false)); | 138 command, GURL("http://google.com"), false)); |
139 EXPECT_FALSE(on_script_ready_called_); | 139 EXPECT_FALSE(on_script_ready_called_); |
140 EXPECT_TRUE(on_translate_complete_called_); | 140 EXPECT_TRUE(on_translate_complete_called_); |
141 EXPECT_FALSE(success_); | 141 EXPECT_FALSE(success_); |
142 } | 142 } |
143 | 143 |
144 } // namespace translate | 144 } // namespace translate |
OLD | NEW |