// found in the LICENSE file.
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_handle.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/scoped_hglobal.h"
STGMEDIUM medium;
EXPECT_EQ(S_OK, com_data->GetData(&format_etc, &medium));
std::wstring output =
- base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get();
+ base::win::ScopedHGlobal<wchar_t*>(medium.hGlobal).get();
EXPECT_EQ(input, output);
ReleaseStgMedium(&medium);
}
HGLOBAL glob = GlobalAlloc(GPTR, sizeof(wchar_t) * (input.size() + 1));
size_t stringsz = input.size();
SIZE_T sz = GlobalSize(glob);
- base::win::ScopedHGlobal<wchar_t> global_lock(glob);
+ base::win::ScopedHGlobal<wchar_t*> global_lock(glob);
wchar_t* buffer_handle = global_lock.get();
wcscpy_s(buffer_handle, input.size() + 1, input.c_str());
medium.hGlobal = glob;
// Construct a new object with the old object so that we can use our access
// APIs.
OSExchangeData data2(data.provider().Clone());
- EXPECT_TRUE(data2.HasURL());
+ EXPECT_TRUE(data2.HasURL(OSExchangeData::CONVERT_FILENAMES));
GURL url_from_data;
std::wstring title;
EXPECT_TRUE(data2.GetURLAndTitle(
OSExchangeData::CONVERT_FILENAMES, &url_from_data, &title));
- GURL reference_url(input);
+ GURL reference_url(in put);
EXPECT_EQ(reference_url.spec(), url_from_data.spec());
}
HGLOBAL glob = GlobalAlloc(GPTR, sizeof(wchar_t) * (input.size() + 1));
size_t stringsz = input.size();
SIZE_T sz = GlobalSize(glob);
- base::win::ScopedHGlobal<wchar_t> global_lock(glob);
+ base::win::ScopedHGlobal<wchar_t*> global_lock(glob);
wchar_t* buffer_handle = global_lock.get();
wcscpy_s(buffer_handle, input.size() + 1, input.c_str());
medium.hGlobal = glob;
HGLOBAL glob = GlobalAlloc(GPTR, sizeof(wchar_t) * (input2.size() + 1));
size_t stringsz = input2.size();
SIZE_T sz = GlobalSize(glob);
- base::win::ScopedHGlobal<wchar_t> global_lock(glob);
+ base::win::ScopedHGlobal<wchar_t*> global_lock(glob);
wchar_t* buffer_handle = global_lock.get();
wcscpy_s(buffer_handle, input2.size() + 1, input2.c_str());
medium.hGlobal = glob;
// Construct a new object with the old object so that we can use our access
// APIs.
OSExchangeData data2(data.provider().Clone());
- EXPECT_TRUE(data2.HasURL());
+ EXPECT_TRUE(data2.HasURL(OSExchangeData::CONVERT_FILENAMES));
GURL url_from_data;
std::wstring title;
EXPECT_TRUE(data2.GetURLAndTitle(
STGMEDIUM medium;
EXPECT_EQ(S_OK, com_data->GetData(&format_etc, &medium));
std::wstring output =
- base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get();
+ base::win::ScopedHGlobal<wchar_t*>(medium.hGlobal).get();
EXPECT_EQ(url.spec(), base::WideToUTF8(output));
ReleaseStgMedium(&medium);
}
STGMEDIUM medium;
EXPECT_EQ(S_OK, com_data->GetData(&url_format_etc, &medium));
std::wstring output_url =
- base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get();
+ base::win::ScopedHGlobal<wchar_t*>(medium.hGlobal).get();
EXPECT_EQ(url.spec(), base::WideToUTF8(output_url));
ReleaseStgMedium(&medium);
// |text|! This is because the URL is added first and thus takes precedence!
EXPECT_EQ(S_OK, com_data->GetData(&text_format_etc, &medium));
std::wstring output_text =
- base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get();
+ base::win::ScopedHGlobal<wchar_t*>(medium.hGlobal).get();
EXPECT_EQ(url_spec, base::WideToUTF8(output_text));
ReleaseStgMedium(&medium);
}
STGMEDIUM medium;
EXPECT_EQ(S_OK, com_data->GetData(&format_etc, &medium));
- base::win::ScopedHGlobal<char> glob(medium.hGlobal);
+ base::win::ScopedHGlobal<char*> glob(medium.hGlobal);
std::string output(glob.get(), glob.Size());
std::string file_contents = "[InternetShortcut]\r\nURL=";
file_contents += url_spec;
STGMEDIUM medium;
IDataObject* data_object = OSExchangeDataProviderWin::GetIDataObject(data);
EXPECT_EQ(S_OK, data_object->GetData(&format, &medium));
- base::win::ScopedHGlobal<char> glob(medium.hGlobal);
+ base::win::ScopedHGlobal<char*> glob(medium.hGlobal);
std::string output(glob.get(), glob.Size());
EXPECT_EQ(expected_cf_html, output);
ReleaseStgMedium(&medium);
data.SetString(L"http://google.com");
OSExchangeData data2(data.provider().Clone());
- ASSERT_TRUE(data2.HasURL());
+ ASSERT_TRUE(data2.HasURL(OSExchangeData::CONVERT_FILENAMES));
GURL read_url;
std::wstring title;
EXPECT_TRUE(data2.GetURLAndTitle(