IndexedDB: Protect against use-after-free in ChainedBlobWriter.
[chromium-blink-merge.git] / rlz / lib / machine_id_unittest.cc
blobb3f3c6184a173371611f14a6e42d8943cc907b51
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
3 // found in the LICENSE file.
5 #include "rlz/lib/machine_id.h"
7 #include "base/strings/string16.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "rlz/test/rlz_test_helpers.h"
10 #include "testing/gtest/include/gtest/gtest.h"
12 // This test will fail if the behavior of GetMachineId changes.
13 TEST(MachineDealCodeTestMachineId, MachineId) {
14 base::string16 computer_sid(base::UTF8ToUTF16(
15 "S-1-5-21-2345599882-2448789067-1921365677"));
16 std::string id;
17 rlz_lib::testing::GetMachineIdImpl(computer_sid, 2651229008, &id);
18 EXPECT_STREQ("A341BA986A7E86840688977FCF20C86E253F00919E068B50F8",
19 id.c_str());