| 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 "components/translate/core/browser/language_state.h" | 5 #include "components/translate/core/browser/language_state.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "components/translate/core/browser/language_state.h" | 8 #include "components/translate/core/browser/language_state.h" |
| 9 #include "components/translate/core/browser/translate_driver.h" | 9 #include "components/translate/core/browser/translate_driver.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 virtual const GURL& GetActiveURL() OVERRIDE { return GURL::EmptyGURL(); } | 64 virtual const GURL& GetActiveURL() OVERRIDE { return GURL::EmptyGURL(); } |
| 65 | 65 |
| 66 virtual const GURL& GetVisibleURL() OVERRIDE { return GURL::EmptyGURL(); } | 66 virtual const GURL& GetVisibleURL() OVERRIDE { return GURL::EmptyGURL(); } |
| 67 | 67 |
| 68 virtual bool HasCurrentPage() OVERRIDE { return true; } | 68 virtual bool HasCurrentPage() OVERRIDE { return true; } |
| 69 | 69 |
| 70 virtual int GetCurrentPageID() OVERRIDE { return 0; } | 70 virtual int GetCurrentPageID() OVERRIDE { return 0; } |
| 71 | 71 |
| 72 virtual void OpenUrlInNewTab(const GURL& url) OVERRIDE {} |
| 73 |
| 72 bool on_is_page_translated_changed_called() const { | 74 bool on_is_page_translated_changed_called() const { |
| 73 return on_is_page_translated_changed_called_; | 75 return on_is_page_translated_changed_called_; |
| 74 } | 76 } |
| 75 | 77 |
| 76 bool on_translate_enabled_changed_called() const { | 78 bool on_translate_enabled_changed_called() const { |
| 77 return on_translate_enabled_changed_called_; | 79 return on_translate_enabled_changed_called_; |
| 78 } | 80 } |
| 79 | 81 |
| 80 private: | 82 private: |
| 81 bool on_is_page_translated_changed_called_; | 83 bool on_is_page_translated_changed_called_; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 141 |
| 140 // Translate. | 142 // Translate. |
| 141 language_state.SetCurrentLanguage("en"); | 143 language_state.SetCurrentLanguage("en"); |
| 142 EXPECT_TRUE(language_state.IsPageTranslated()); | 144 EXPECT_TRUE(language_state.IsPageTranslated()); |
| 143 EXPECT_TRUE(driver->on_is_page_translated_changed_called()); | 145 EXPECT_TRUE(driver->on_is_page_translated_changed_called()); |
| 144 | 146 |
| 145 // Translate feature must be enabled after an actual translation. | 147 // Translate feature must be enabled after an actual translation. |
| 146 EXPECT_TRUE(language_state.translate_enabled()); | 148 EXPECT_TRUE(language_state.translate_enabled()); |
| 147 EXPECT_TRUE(driver->on_translate_enabled_changed_called()); | 149 EXPECT_TRUE(driver->on_translate_enabled_changed_called()); |
| 148 } | 150 } |
| OLD | NEW |