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

Unified Diff: ios/chrome/browser/translate/js_language_detection_manager_unittest.mm

Issue 2617243002: Remove ScopedVector from ios/. (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/ui/bookmarks/bookmark_all_collection_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/translate/js_language_detection_manager_unittest.mm
diff --git a/ios/chrome/browser/translate/js_language_detection_manager_unittest.mm b/ios/chrome/browser/translate/js_language_detection_manager_unittest.mm
index c506eb8ea4983e34168d8db544af3da161d3520c..6ec7d4270f00cde44f9f84c9dd7dbae53a3004d2 100644
--- a/ios/chrome/browser/translate/js_language_detection_manager_unittest.mm
+++ b/ios/chrome/browser/translate/js_language_detection_manager_unittest.mm
@@ -6,9 +6,11 @@
#include <string.h>
+#include <memory>
+#include <vector>
+
#include "base/bind.h"
#include "base/mac/scoped_nsobject.h"
-#include "base/memory/scoped_vector.h"
#import "base/test/ios/wait_util.h"
#include "base/values.h"
#import "ios/chrome/browser/web/chrome_web_test.h"
@@ -272,13 +274,13 @@ class JsLanguageDetectionManagerDetectLanguageTest
bool CommandReceived(const base::DictionaryValue& command,
const GURL&,
bool) {
- commands_received_.push_back(command.DeepCopy());
+ commands_received_.push_back(command.CreateDeepCopy());
return true;
}
protected:
// Received "languageDetection" commands.
- ScopedVector<base::DictionaryValue> commands_received_;
+ std::vector<std::unique_ptr<base::DictionaryValue>> commands_received_;
};
// Tests if |__gCrWeb.languageDetection.detectLanguage| correctly informs the
@@ -307,7 +309,7 @@ TEST_F(JsLanguageDetectionManagerDetectLanguageTest,
InjectJSAndWaitUntilCondition(@"__gCrWeb.languageDetection.detectLanguage()",
commands_recieved_block);
ASSERT_EQ(1U, commands_received_.size());
- base::DictionaryValue* value = commands_received_[0];
+ base::DictionaryValue* value = commands_received_[0].get();
EXPECT_TRUE(value->HasKey("translationAllowed"));
bool translation_allowed = true;
value->GetBoolean("translationAllowed", &translation_allowed);
@@ -338,7 +340,7 @@ TEST_F(JsLanguageDetectionManagerDetectLanguageTest,
return !commands_received_.empty();
});
ASSERT_EQ(1U, commands_received_.size());
- base::DictionaryValue* value = commands_received_[0];
+ base::DictionaryValue* value = commands_received_[0].get();
EXPECT_TRUE(value->HasKey("translationAllowed"));
EXPECT_TRUE(value->HasKey("captureTextTime"));
« no previous file with comments | « no previous file | ios/chrome/browser/ui/bookmarks/bookmark_all_collection_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698