Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 10cb851

Browse files
authored
Move TestMetalContext/Surface to testing namespace (#56602)
The Metal context/surface code was only in the `flutter` namespace but should have been in `flutter::testing` for consistency with everything else in the `testing` directory. Also squashes the declarations in the rest of that directory to match the style guide while I've got the macro still handy. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent d784a38 commit 10cb851

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+89
-162
lines changed

testing/assertions.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77

88
#include <type_traits>
99

10-
namespace flutter {
11-
namespace testing {
10+
namespace flutter::testing {
1211

1312
inline bool NumberNear(double a, double b) {
1413
static const double epsilon = 1e-3;
1514
return (a > (b - epsilon)) && (a < (b + epsilon));
1615
}
1716

18-
} // namespace testing
19-
} // namespace flutter
17+
} // namespace flutter::testing
2018

2119
#endif // FLUTTER_TESTING_ASSERTIONS_H_

testing/canvas_test.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
#include "gtest/gtest.h"
1010
#include "third_party/skia/include/core/SkColorSpace.h"
1111

12-
namespace flutter {
13-
namespace testing {
12+
namespace flutter::testing {
1413

1514
// This fixture allows creating tests that make use of a mock |SkCanvas|.
1615
template <typename BaseT>
@@ -27,7 +26,6 @@ class CanvasTestBase : public BaseT {
2726
};
2827
using CanvasTest = CanvasTestBase<::testing::Test>;
2928

30-
} // namespace testing
31-
} // namespace flutter
29+
} // namespace flutter::testing
3230

3331
#endif // FLUTTER_TESTING_CANVAS_TEST_H_

testing/dart_isolate_runner.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "flutter/runtime/isolate_configuration.h"
1010

11-
namespace flutter {
12-
namespace testing {
11+
namespace flutter::testing {
12+
1313
AutoIsolateShutdown::AutoIsolateShutdown(std::shared_ptr<DartIsolate> isolate,
1414
fml::RefPtr<fml::TaskRunner> runner)
1515
: isolate_(std::move(isolate)), runner_(std::move(runner)) {}
@@ -173,5 +173,4 @@ std::unique_ptr<AutoIsolateShutdown> RunDartCodeInIsolate(
173173
return result;
174174
}
175175

176-
} // namespace testing
177-
} // namespace flutter
176+
} // namespace flutter::testing

testing/dart_isolate_runner.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
#include "flutter/runtime/dart_vm.h"
1515
#include "flutter/runtime/dart_vm_lifecycle.h"
1616

17-
namespace flutter {
18-
namespace testing {
17+
namespace flutter::testing {
1918

2019
class AutoIsolateShutdown {
2120
public:
@@ -66,7 +65,6 @@ std::unique_ptr<AutoIsolateShutdown> RunDartCodeInIsolate(
6665
fml::WeakPtr<IOManager> io_manager = {},
6766
std::unique_ptr<PlatformConfiguration> platform_configuration = nullptr);
6867

69-
} // namespace testing
70-
} // namespace flutter
68+
} // namespace flutter::testing
7169

7270
#endif // FLUTTER_TESTING_DART_ISOLATE_RUNNER_H_

testing/debugger_detection.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
#include <windows.h>
2020
#endif // FML_OS_WIN
2121

22-
namespace flutter {
23-
namespace testing {
22+
namespace flutter::testing {
2423

2524
DebuggerStatus GetDebuggerStatus() {
2625
#if FML_OS_MACOSX
@@ -61,7 +60,6 @@ DebuggerStatus GetDebuggerStatus() {
6160
#else
6261
return DebuggerStatus::kDontKnow;
6362
#endif
64-
} // namespace testing
63+
}
6564

66-
} // namespace testing
67-
} // namespace flutter
65+
} // namespace flutter::testing

testing/debugger_detection.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
#include "flutter/fml/macros.h"
99

10-
namespace flutter {
11-
namespace testing {
10+
namespace flutter::testing {
1211

1312
enum class DebuggerStatus {
1413
kDontKnow,
@@ -17,7 +16,6 @@ enum class DebuggerStatus {
1716

1817
DebuggerStatus GetDebuggerStatus();
1918

20-
} // namespace testing
21-
} // namespace flutter
19+
} // namespace flutter::testing
2220

2321
#endif // FLUTTER_TESTING_DEBUGGER_DETECTION_H_

testing/display_list_testing.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include "flutter/display_list/display_list.h"
1111
#include "flutter/display_list/effects/dl_image_filter.h"
1212

13-
namespace flutter {
14-
namespace testing {
13+
namespace flutter::testing {
1514

1615
// clang-format off
1716
bool DisplayListsEQ_Verbose(const DisplayList* a, const DisplayList* b) {
@@ -37,8 +36,7 @@ bool DisplayListsNE_Verbose(const DisplayList* a, const DisplayList* b) {
3736
return true;
3837
}
3938

40-
} // namespace testing
41-
} // namespace flutter
39+
} // namespace flutter::testing
4240

4341
namespace std {
4442

@@ -389,8 +387,7 @@ std::ostream& operator<<(std::ostream& os, const DlImage* image) {
389387

390388
} // namespace std
391389

392-
namespace flutter {
393-
namespace testing {
390+
namespace flutter::testing {
394391

395392
std::ostream& DisplayListStreamDispatcher::startl() {
396393
for (int i = 0; i < cur_indent_; i++) {
@@ -978,5 +975,4 @@ void DisplayListStreamDispatcher::drawShadow(const DlPath& path,
978975
}
979976
// clang-format on
980977

981-
} // namespace testing
982-
} // namespace flutter
978+
} // namespace flutter::testing

testing/display_list_testing.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
#include "flutter/display_list/display_list.h"
1212
#include "flutter/display_list/dl_op_receiver.h"
1313

14-
namespace flutter {
15-
namespace testing {
14+
namespace flutter::testing {
1615

1716
[[nodiscard]] bool DisplayListsEQ_Verbose(const DisplayList* a,
1817
const DisplayList* b);
@@ -37,8 +36,7 @@ namespace testing {
3736
return DisplayListsNE_Verbose(a.get(), b.get());
3837
}
3938

40-
} // namespace testing
41-
} // namespace flutter
39+
} // namespace flutter::testing
4240

4341
namespace std {
4442

@@ -84,8 +82,7 @@ extern std::ostream& operator<<(std::ostream& os, const flutter::DlPath& path);
8482

8583
} // namespace std
8684

87-
namespace flutter {
88-
namespace testing {
85+
namespace flutter::testing {
8986

9087
class DisplayListStreamDispatcher final : public DlOpReceiver {
9188
public:
@@ -609,7 +606,6 @@ class DisplayListGeneralReceiver : public DlOpReceiver {
609606
uint32_t op_count_ = 0u;
610607
};
611608

612-
} // namespace testing
613-
} // namespace flutter
609+
} // namespace flutter::testing
614610

615611
#endif // FLUTTER_TESTING_DISPLAY_LIST_TESTING_H_

testing/elf_loader.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
#include "flutter/runtime/dart_vm.h"
1212
#include "flutter/testing/testing.h"
1313

14-
namespace flutter {
15-
namespace testing {
14+
namespace flutter::testing {
1615

1716
ELFAOTSymbols LoadELFSymbolFromFixturesIfNeccessary(std::string elf_filename) {
1817
if (!DartVM::IsRunningPrecompiledCode()) {
@@ -135,5 +134,4 @@ bool PrepareSettingsForAOTWithSymbols(Settings& settings,
135134
return true;
136135
}
137136

138-
} // namespace testing
139-
} // namespace flutter
137+
} // namespace flutter::testing

testing/elf_loader.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
#include "flutter/fml/macros.h"
1212
#include "third_party/dart/runtime/bin/elf_loader.h"
1313

14-
namespace flutter {
15-
namespace testing {
14+
namespace flutter::testing {
1615

1716
inline constexpr const char* kDefaultAOTAppELFFileName = "app_elf_snapshot.so";
1817

@@ -81,7 +80,6 @@ ELFAOTSymbols LoadELFSplitSymbolFromFixturesIfNeccessary(
8180
bool PrepareSettingsForAOTWithSymbols(Settings& settings,
8281
const ELFAOTSymbols& symbols);
8382

84-
} // namespace testing
85-
} // namespace flutter
83+
} // namespace flutter::testing
8684

8785
#endif // FLUTTER_TESTING_ELF_LOADER_H_

0 commit comments

Comments
 (0)