diff options
Diffstat (limited to 'webkit/tools/test_shell/test_shell_gtk.cc')
-rw-r--r-- | webkit/tools/test_shell/test_shell_gtk.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc index 972256e..f1087a8 100644 --- a/webkit/tools/test_shell/test_shell_gtk.cc +++ b/webkit/tools/test_shell/test_shell_gtk.cc @@ -11,10 +11,12 @@ #include <signal.h> #include <unistd.h> +#include "base/data_pack.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/message_loop.h" #include "base/path_service.h" +#include "base/string_piece.h" #include "base/string_util.h" #include "net/base/mime_util.h" #include "net/base/net_util.h" @@ -616,6 +618,24 @@ void TestShell::ShowStartupDebuggingDialog() { gtk_widget_destroy(dialog); } +// static +StringPiece TestShell::NetResourceProvider(int key) { + static scoped_ptr<base::DataPack> resource_data_pack; + + if (!resource_data_pack.get()) { + resource_data_pack.reset(new base::DataPack); + FilePath data_path; + PathService::Get(base::DIR_EXE, &data_path); + data_path = data_path.Append("test_shell.pak"); + bool success = resource_data_pack->Load(data_path); + CHECK(success) << "failed to load test_shell.pak"; + } + + StringPiece res; + resource_data_pack->Get(key, &res); + return res; +} + //----------------------------------------------------------------------------- namespace webkit_glue { |