OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/files/file_util.h" | 5 #include "base/files/file_util.h" |
6 #include "services/js/test/js_application_test_base.h" | 6 #include "services/js/test/js_application_test_base.h" |
7 #include "services/js/test/network_test_service.mojom.h" | 7 #include "services/js/test/network_test_service.mojom.h" |
8 | 8 |
9 namespace js { | 9 namespace js { |
10 namespace { | 10 namespace { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 TEST_F(JSNetworkTest, GetFileSize) { | 44 TEST_F(JSNetworkTest, GetFileSize) { |
45 const std::string filename("network_test.js"); | 45 const std::string filename("network_test.js"); |
46 int64 expected_file_size; | 46 int64 expected_file_size; |
47 EXPECT_TRUE(GetFileSize(JSAppPath(filename), &expected_file_size)); | 47 EXPECT_TRUE(GetFileSize(JSAppPath(filename), &expected_file_size)); |
48 EXPECT_TRUE(expected_file_size > 0); | 48 EXPECT_TRUE(expected_file_size > 0); |
49 | 49 |
50 bool file_size_ok; | 50 bool file_size_ok; |
51 uint64 file_size; | 51 uint64 file_size; |
52 GetFileSizeCallback callback(&file_size_ok, &file_size); | 52 GetFileSizeCallback callback(&file_size_ok, &file_size); |
53 network_test_service_->GetFileSize(JSAppURL(filename), callback); | 53 network_test_service_->GetFileSize(JSAppURL(filename), callback); |
54 EXPECT_TRUE(network_test_service_.WaitForIncomingMethodCall()); | 54 EXPECT_TRUE(network_test_service_.WaitForIncomingResponse()); |
55 EXPECT_TRUE(file_size_ok); | 55 EXPECT_TRUE(file_size_ok); |
56 EXPECT_EQ(file_size, static_cast<uint64>(expected_file_size)); | 56 EXPECT_EQ(file_size, static_cast<uint64>(expected_file_size)); |
57 network_test_service_->Quit(); | 57 network_test_service_->Quit(); |
58 } | 58 } |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 } // namespace js | 61 } // namespace js |
62 | 62 |
OLD | NEW |