OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8_proxy.h" | 5 #include "v8_proxy.h" |
6 #undef LOG | 6 #undef LOG |
7 | 7 |
8 #include "webkit/tools/test_shell/test_shell.h" | 8 #include "webkit/tools/test_shell/test_shell.h" |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const int kSVGTestWindowWidth = 480; | 59 const int kSVGTestWindowWidth = 480; |
60 const int kSVGTestWindowHeight = 360; | 60 const int kSVGTestWindowHeight = 360; |
61 | 61 |
62 // URLRequestTestShellFileJob is used to serve the inspector | 62 // URLRequestTestShellFileJob is used to serve the inspector |
63 class URLRequestTestShellFileJob : public URLRequestFileJob { | 63 class URLRequestTestShellFileJob : public URLRequestFileJob { |
64 public: | 64 public: |
65 virtual ~URLRequestTestShellFileJob() { } | 65 virtual ~URLRequestTestShellFileJob() { } |
66 | 66 |
67 static URLRequestJob* InspectorFactory(URLRequest* request, | 67 static URLRequestJob* InspectorFactory(URLRequest* request, |
68 const std::string& scheme) { | 68 const std::string& scheme) { |
69 std::wstring path; | 69 FilePath path; |
70 PathService::Get(base::DIR_EXE, &path); | 70 PathService::Get(base::DIR_EXE, &path); |
71 file_util::AppendToPath(&path, L"resources"); | 71 path = path.AppendASCII("resources"); |
72 file_util::AppendToPath(&path, L"inspector"); | 72 path = path.AppendASCII("inspector"); |
73 file_util::AppendToPath(&path, UTF8ToWide(request->url().path())); | 73 path = path.AppendASCII(request->url().path()); |
74 return new URLRequestTestShellFileJob(request, | 74 return new URLRequestTestShellFileJob(request, path); |
75 FilePath::FromWStringHack(path)); | |
76 } | 75 } |
77 | 76 |
78 private: | 77 private: |
79 URLRequestTestShellFileJob(URLRequest* request, const FilePath& path) | 78 URLRequestTestShellFileJob(URLRequest* request, const FilePath& path) |
80 : URLRequestFileJob(request, path) { | 79 : URLRequestFileJob(request, path) { |
81 } | 80 } |
82 | 81 |
83 DISALLOW_COPY_AND_ASSIGN(URLRequestTestShellFileJob); | 82 DISALLOW_COPY_AND_ASSIGN(URLRequestTestShellFileJob); |
84 }; | 83 }; |
85 | 84 |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 return g_media_player_available; | 575 return g_media_player_available; |
577 } | 576 } |
578 | 577 |
579 void PrecacheUrl(const char16* url, int url_length) {} | 578 void PrecacheUrl(const char16* url, int url_length) {} |
580 | 579 |
581 void AppendToLog(const char* file, int line, const char* msg) { | 580 void AppendToLog(const char* file, int line, const char* msg) { |
582 logging::LogMessage(file, line).stream() << msg; | 581 logging::LogMessage(file, line).stream() << msg; |
583 } | 582 } |
584 | 583 |
585 bool GetApplicationDirectory(std::wstring *path) { | 584 bool GetApplicationDirectory(std::wstring *path) { |
586 return PathService::Get(base::DIR_EXE, path); | 585 bool r; |
| 586 FilePath fp; |
| 587 r = PathService::Get(base::DIR_EXE, &fp); |
| 588 *path = fp.ToWStringHack(); |
| 589 return r; |
587 } | 590 } |
588 | 591 |
589 GURL GetInspectorURL() { | 592 GURL GetInspectorURL() { |
590 return GURL("test-shell-resource://inspector/inspector.html"); | 593 return GURL("test-shell-resource://inspector/inspector.html"); |
591 } | 594 } |
592 | 595 |
593 std::string GetUIResourceProtocol() { | 596 std::string GetUIResourceProtocol() { |
594 return "test-shell-resource"; | 597 return "test-shell-resource"; |
595 } | 598 } |
596 | 599 |
597 bool GetExeDirectory(std::wstring *path) { | 600 bool GetExeDirectory(std::wstring *path) { |
598 return PathService::Get(base::DIR_EXE, path); | 601 return GetApplicationDirectory(path); |
599 } | 602 } |
600 | 603 |
601 bool SpellCheckWord(const wchar_t* word, int word_len, | 604 bool SpellCheckWord(const wchar_t* word, int word_len, |
602 int* misspelling_start, int* misspelling_len) { | 605 int* misspelling_start, int* misspelling_len) { |
603 // Report all words being correctly spelled. | 606 // Report all words being correctly spelled. |
604 *misspelling_start = 0; | 607 *misspelling_start = 0; |
605 *misspelling_len = 0; | 608 *misspelling_len = 0; |
606 return true; | 609 return true; |
607 } | 610 } |
608 | 611 |
(...skipping 17 matching lines...) Expand all Loading... |
626 } | 629 } |
627 #endif // OS_WIN | 630 #endif // OS_WIN |
628 return false; | 631 return false; |
629 } | 632 } |
630 | 633 |
631 std::wstring GetWebKitLocale() { | 634 std::wstring GetWebKitLocale() { |
632 return L"en-US"; | 635 return L"en-US"; |
633 } | 636 } |
634 | 637 |
635 } // namespace webkit_glue | 638 } // namespace webkit_glue |
OLD | NEW |