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

Unified Diff: content/browser/dom_storage/local_storage_context_mojo_unittest.cc

Issue 2767103002: Fix localstorage data migration. (Closed)
Patch Set: share one encoding function Created 3 years, 9 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 | « content/browser/dom_storage/local_storage_context_mojo.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/dom_storage/local_storage_context_mojo_unittest.cc
diff --git a/content/browser/dom_storage/local_storage_context_mojo_unittest.cc b/content/browser/dom_storage/local_storage_context_mojo_unittest.cc
index b22117d7e4efa515ecaa79e787f3f38cee167d21..0f4fa583502eccf7c5d20622f75cda993a80f2eb 100644
--- a/content/browser/dom_storage/local_storage_context_mojo_unittest.cc
+++ b/content/browser/dom_storage/local_storage_context_mojo_unittest.cc
@@ -62,11 +62,6 @@ void GetCallback(const base::Closure& callback,
void NoOpGet(bool success, const std::vector<uint8_t>& value) {}
-std::vector<uint8_t> String16ToUint8Vector(const base::string16& input) {
- const uint8_t* data = reinterpret_cast<const uint8_t*>(input.data());
- return std::vector<uint8_t>(data, data + input.size() * sizeof(base::char16));
-}
-
class TestLevelDBObserver : public mojom::LevelDBObserver {
public:
struct Observation {
@@ -602,11 +597,11 @@ TEST_F(LocalStorageContextMojoTest, Migration) {
bool success = false;
std::vector<uint8_t> result;
wrapper->Get(
- String16ToUint8Vector(key),
+ LocalStorageContextMojo::MigrateString(key),
base::Bind(&GetCallback, run_loop.QuitClosure(), &success, &result));
run_loop.Run();
EXPECT_TRUE(success);
- EXPECT_EQ(String16ToUint8Vector(value), result);
+ EXPECT_EQ(LocalStorageContextMojo::MigrateString(value), result);
// Origin1 should no longer exist in old storage.
area = local->OpenStorageArea(origin1.GetURL());
« no previous file with comments | « content/browser/dom_storage/local_storage_context_mojo.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698