diff --git a/testing/assertions.h b/testing/assertions.h index a6e7b22fbc24e..68cea9675e712 100644 --- a/testing/assertions.h +++ b/testing/assertions.h @@ -7,15 +7,13 @@ #include -namespace flutter { -namespace testing { +namespace flutter::testing { inline bool NumberNear(double a, double b) { static const double epsilon = 1e-3; return (a > (b - epsilon)) && (a < (b + epsilon)); } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_ASSERTIONS_H_ diff --git a/testing/canvas_test.h b/testing/canvas_test.h index 8333257f81df0..843af5adec380 100644 --- a/testing/canvas_test.h +++ b/testing/canvas_test.h @@ -9,8 +9,7 @@ #include "gtest/gtest.h" #include "third_party/skia/include/core/SkColorSpace.h" -namespace flutter { -namespace testing { +namespace flutter::testing { // This fixture allows creating tests that make use of a mock |SkCanvas|. template @@ -27,7 +26,6 @@ class CanvasTestBase : public BaseT { }; using CanvasTest = CanvasTestBase<::testing::Test>; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_CANVAS_TEST_H_ diff --git a/testing/dart_isolate_runner.cc b/testing/dart_isolate_runner.cc index c0b42a34430bf..d94975117fab9 100644 --- a/testing/dart_isolate_runner.cc +++ b/testing/dart_isolate_runner.cc @@ -8,8 +8,8 @@ #include "flutter/runtime/isolate_configuration.h" -namespace flutter { -namespace testing { +namespace flutter::testing { + AutoIsolateShutdown::AutoIsolateShutdown(std::shared_ptr isolate, fml::RefPtr runner) : isolate_(std::move(isolate)), runner_(std::move(runner)) {} @@ -173,5 +173,4 @@ std::unique_ptr RunDartCodeInIsolate( return result; } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/dart_isolate_runner.h b/testing/dart_isolate_runner.h index a6dac4c316dd3..c2459c73b361b 100644 --- a/testing/dart_isolate_runner.h +++ b/testing/dart_isolate_runner.h @@ -14,8 +14,7 @@ #include "flutter/runtime/dart_vm.h" #include "flutter/runtime/dart_vm_lifecycle.h" -namespace flutter { -namespace testing { +namespace flutter::testing { class AutoIsolateShutdown { public: @@ -66,7 +65,6 @@ std::unique_ptr RunDartCodeInIsolate( fml::WeakPtr io_manager = {}, std::unique_ptr platform_configuration = nullptr); -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_DART_ISOLATE_RUNNER_H_ diff --git a/testing/debugger_detection.cc b/testing/debugger_detection.cc index daea74636d20f..2a9dadeb50b53 100644 --- a/testing/debugger_detection.cc +++ b/testing/debugger_detection.cc @@ -19,8 +19,7 @@ #include #endif // FML_OS_WIN -namespace flutter { -namespace testing { +namespace flutter::testing { DebuggerStatus GetDebuggerStatus() { #if FML_OS_MACOSX @@ -61,7 +60,6 @@ DebuggerStatus GetDebuggerStatus() { #else return DebuggerStatus::kDontKnow; #endif -} // namespace testing +} -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/debugger_detection.h b/testing/debugger_detection.h index 7745cfb319aa5..48e0e578c400a 100644 --- a/testing/debugger_detection.h +++ b/testing/debugger_detection.h @@ -7,8 +7,7 @@ #include "flutter/fml/macros.h" -namespace flutter { -namespace testing { +namespace flutter::testing { enum class DebuggerStatus { kDontKnow, @@ -17,7 +16,6 @@ enum class DebuggerStatus { DebuggerStatus GetDebuggerStatus(); -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_DEBUGGER_DETECTION_H_ diff --git a/testing/display_list_testing.cc b/testing/display_list_testing.cc index 88bd51d6e2ea6..5f29f40816b56 100644 --- a/testing/display_list_testing.cc +++ b/testing/display_list_testing.cc @@ -10,8 +10,7 @@ #include "flutter/display_list/display_list.h" #include "flutter/display_list/effects/dl_image_filter.h" -namespace flutter { -namespace testing { +namespace flutter::testing { // clang-format off bool DisplayListsEQ_Verbose(const DisplayList* a, const DisplayList* b) { @@ -37,8 +36,7 @@ bool DisplayListsNE_Verbose(const DisplayList* a, const DisplayList* b) { return true; } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing namespace std { @@ -389,8 +387,7 @@ std::ostream& operator<<(std::ostream& os, const DlImage* image) { } // namespace std -namespace flutter { -namespace testing { +namespace flutter::testing { std::ostream& DisplayListStreamDispatcher::startl() { for (int i = 0; i < cur_indent_; i++) { @@ -978,5 +975,4 @@ void DisplayListStreamDispatcher::drawShadow(const DlPath& path, } // clang-format on -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/display_list_testing.h b/testing/display_list_testing.h index 6dc8f8136ca37..8ffc5c0b854fb 100644 --- a/testing/display_list_testing.h +++ b/testing/display_list_testing.h @@ -11,8 +11,7 @@ #include "flutter/display_list/display_list.h" #include "flutter/display_list/dl_op_receiver.h" -namespace flutter { -namespace testing { +namespace flutter::testing { [[nodiscard]] bool DisplayListsEQ_Verbose(const DisplayList* a, const DisplayList* b); @@ -37,8 +36,7 @@ namespace testing { return DisplayListsNE_Verbose(a.get(), b.get()); } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing namespace std { @@ -84,8 +82,7 @@ extern std::ostream& operator<<(std::ostream& os, const flutter::DlPath& path); } // namespace std -namespace flutter { -namespace testing { +namespace flutter::testing { class DisplayListStreamDispatcher final : public DlOpReceiver { public: @@ -609,7 +606,6 @@ class DisplayListGeneralReceiver : public DlOpReceiver { uint32_t op_count_ = 0u; }; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_DISPLAY_LIST_TESTING_H_ diff --git a/testing/elf_loader.cc b/testing/elf_loader.cc index d420d841d94b8..d7cff00b060fa 100644 --- a/testing/elf_loader.cc +++ b/testing/elf_loader.cc @@ -11,8 +11,7 @@ #include "flutter/runtime/dart_vm.h" #include "flutter/testing/testing.h" -namespace flutter { -namespace testing { +namespace flutter::testing { ELFAOTSymbols LoadELFSymbolFromFixturesIfNeccessary(std::string elf_filename) { if (!DartVM::IsRunningPrecompiledCode()) { @@ -135,5 +134,4 @@ bool PrepareSettingsForAOTWithSymbols(Settings& settings, return true; } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/elf_loader.h b/testing/elf_loader.h index fb9ff47b08182..6547ae77c216c 100644 --- a/testing/elf_loader.h +++ b/testing/elf_loader.h @@ -11,8 +11,7 @@ #include "flutter/fml/macros.h" #include "third_party/dart/runtime/bin/elf_loader.h" -namespace flutter { -namespace testing { +namespace flutter::testing { inline constexpr const char* kDefaultAOTAppELFFileName = "app_elf_snapshot.so"; @@ -81,7 +80,6 @@ ELFAOTSymbols LoadELFSplitSymbolFromFixturesIfNeccessary( bool PrepareSettingsForAOTWithSymbols(Settings& settings, const ELFAOTSymbols& symbols); -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_ELF_LOADER_H_ diff --git a/testing/fixture_test.cc b/testing/fixture_test.cc index dee760990cc7e..7d54779ff321a 100644 --- a/testing/fixture_test.cc +++ b/testing/fixture_test.cc @@ -8,8 +8,7 @@ #include "flutter/testing/dart_fixture.h" -namespace flutter { -namespace testing { +namespace flutter::testing { FixtureTest::FixtureTest() : DartFixture() {} @@ -20,5 +19,4 @@ FixtureTest::FixtureTest(std::string kernel_filename, std::move(elf_filename), std::move(elf_split_filename)) {} -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/fixture_test.h b/testing/fixture_test.h index f54bc80d28a2f..df424f0356d82 100644 --- a/testing/fixture_test.h +++ b/testing/fixture_test.h @@ -7,8 +7,7 @@ #include "flutter/testing/dart_fixture.h" -namespace flutter { -namespace testing { +namespace flutter::testing { class FixtureTest : public DartFixture, public ThreadTest { public: @@ -24,7 +23,6 @@ class FixtureTest : public DartFixture, public ThreadTest { FML_DISALLOW_COPY_AND_ASSIGN(FixtureTest); }; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_FIXTURE_TEST_H_ diff --git a/testing/post_task_sync.cc b/testing/post_task_sync.cc index 1a4b2a1f0671f..0861828fa6f64 100644 --- a/testing/post_task_sync.cc +++ b/testing/post_task_sync.cc @@ -6,8 +6,7 @@ #include "flutter/fml/synchronization/waitable_event.h" -namespace flutter { -namespace testing { +namespace flutter::testing { void PostTaskSync(const fml::RefPtr& task_runner, const std::function& function) { @@ -19,5 +18,4 @@ void PostTaskSync(const fml::RefPtr& task_runner, latch.Wait(); } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/post_task_sync.h b/testing/post_task_sync.h index ea9b64d0f0109..a551a485dd27f 100644 --- a/testing/post_task_sync.h +++ b/testing/post_task_sync.h @@ -7,13 +7,11 @@ #include "flutter/fml/task_runner.h" -namespace flutter { -namespace testing { +namespace flutter::testing { void PostTaskSync(const fml::RefPtr& task_runner, const std::function& function); -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_POST_TASK_SYNC_H_ diff --git a/testing/stream_capture.cc b/testing/stream_capture.cc index ed02282f4dc19..a249e44cc7107 100644 --- a/testing/stream_capture.cc +++ b/testing/stream_capture.cc @@ -4,8 +4,7 @@ #include "flutter/testing/stream_capture.h" -namespace flutter { -namespace testing { +namespace flutter::testing { StreamCapture::StreamCapture(std::ostream* ostream) : ostream_(ostream), old_buffer_(ostream_->rdbuf()) { @@ -27,5 +26,4 @@ std::string StreamCapture::GetOutput() const { return buffer_.str(); } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/stream_capture.h b/testing/stream_capture.h index 0b0db4863814a..d19daab80dbf4 100644 --- a/testing/stream_capture.h +++ b/testing/stream_capture.h @@ -9,8 +9,7 @@ #include #include -namespace flutter { -namespace testing { +namespace flutter::testing { // Temporarily replaces the specified stream's output buffer to capture output. // @@ -41,7 +40,6 @@ class StreamCapture { std::streambuf* old_buffer_; }; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_STREAM_CAPTURE_H_ diff --git a/testing/test_args.cc b/testing/test_args.cc index ace858cd64e7f..60c077aa091fb 100644 --- a/testing/test_args.cc +++ b/testing/test_args.cc @@ -4,8 +4,7 @@ #include "flutter/testing/test_args.h" -namespace flutter { -namespace testing { +namespace flutter::testing { static fml::CommandLine gProcessArgs; @@ -17,5 +16,4 @@ void SetArgsForProcess(int argc, char** argv) { gProcessArgs = fml::CommandLineFromArgcArgv(argc, argv); } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_args.h b/testing/test_args.h index 494359b060ada..9b3ea250c800b 100644 --- a/testing/test_args.h +++ b/testing/test_args.h @@ -7,14 +7,12 @@ #include "flutter/fml/command_line.h" -namespace flutter { -namespace testing { +namespace flutter::testing { const fml::CommandLine& GetArgsForProcess(); void SetArgsForProcess(int argc, char** argv); -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TEST_ARGS_H_ diff --git a/testing/test_dart_native_resolver.cc b/testing/test_dart_native_resolver.cc index b96371f514e52..9c56a90c00272 100644 --- a/testing/test_dart_native_resolver.cc +++ b/testing/test_dart_native_resolver.cc @@ -11,8 +11,7 @@ #include "third_party/tonic/logging/dart_error.h" #include "tonic/converter/dart_converter.h" -namespace flutter { -namespace testing { +namespace flutter::testing { TestDartNativeResolver::TestDartNativeResolver() = default; @@ -124,5 +123,4 @@ void TestDartNativeResolver::SetNativeResolverForIsolate() { } } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_dart_native_resolver.h b/testing/test_dart_native_resolver.h index bd0a3fe0882dd..87174379f2309 100644 --- a/testing/test_dart_native_resolver.h +++ b/testing/test_dart_native_resolver.h @@ -23,8 +23,7 @@ return entrypoint; \ })() -namespace flutter { -namespace testing { +namespace flutter::testing { using NativeEntry = std::function; @@ -56,7 +55,6 @@ class TestDartNativeResolver FML_DISALLOW_COPY_AND_ASSIGN(TestDartNativeResolver); }; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TEST_DART_NATIVE_RESOLVER_H_ diff --git a/testing/test_gl_surface.cc b/testing/test_gl_surface.cc index 198cdc026dbee..d49c7abe21249 100644 --- a/testing/test_gl_surface.cc +++ b/testing/test_gl_surface.cc @@ -24,8 +24,7 @@ #include "third_party/skia/include/gpu/ganesh/gl/GrGLDirectContext.h" #include "third_party/skia/include/gpu/ganesh/gl/GrGLTypes.h" -namespace flutter { -namespace testing { +namespace flutter::testing { static std::string GetEGLError() { std::stringstream stream; @@ -433,5 +432,4 @@ bool TestGLSurface::MakeResourceCurrent() { return result == EGL_TRUE; } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_gl_surface.h b/testing/test_gl_surface.h index 437c7188e6b6c..12b14c935d2ee 100644 --- a/testing/test_gl_surface.h +++ b/testing/test_gl_surface.h @@ -12,8 +12,7 @@ #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/ganesh/GrDirectContext.h" -namespace flutter { -namespace testing { +namespace flutter::testing { struct TestEGLContext { explicit TestEGLContext(); @@ -96,7 +95,6 @@ class TestGLSurface : public TestGLOnscreenOnlySurface { FML_DISALLOW_COPY_AND_ASSIGN(TestGLSurface); }; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TEST_GL_SURFACE_H_ diff --git a/testing/test_metal_context.h b/testing/test_metal_context.h index c0c8f8c71b301..a0955f1db2ce4 100644 --- a/testing/test_metal_context.h +++ b/testing/test_metal_context.h @@ -12,7 +12,7 @@ #include "third_party/skia/include/gpu/ganesh/GrDirectContext.h" #include "third_party/skia/include/ports/SkCFObject.h" -namespace flutter { +namespace flutter::testing { struct MetalObjCFields; @@ -48,6 +48,6 @@ class TestMetalContext { std::map> textures_; // guarded by textures_mutex }; -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TEST_METAL_CONTEXT_H_ diff --git a/testing/test_metal_context.mm b/testing/test_metal_context.mm index 38f51569fb208..4301a0ab0d386 100644 --- a/testing/test_metal_context.mm +++ b/testing/test_metal_context.mm @@ -15,7 +15,7 @@ static_assert(__has_feature(objc_arc), "ARC must be enabled."); -namespace flutter { +namespace flutter::testing { // TOOD(cbracken): https://github.com/flutter/flutter/issues/157942 struct MetalObjCFields { @@ -133,4 +133,4 @@ } } -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_metal_surface.h b/testing/test_metal_surface.h index 9d1698cef87ab..44441d815b044 100644 --- a/testing/test_metal_surface.h +++ b/testing/test_metal_surface.h @@ -11,7 +11,7 @@ #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/ganesh/GrDirectContext.h" -namespace flutter { +namespace flutter::testing { //------------------------------------------------------------------------------ /// @brief Creates a MTLTexture backed SkSurface and context that can be @@ -53,6 +53,6 @@ class TestMetalSurface { FML_DISALLOW_COPY_AND_ASSIGN(TestMetalSurface); }; -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TEST_METAL_SURFACE_H_ diff --git a/testing/test_metal_surface.mm b/testing/test_metal_surface.mm index 8aa4b0d673fed..43f67f87569b7 100644 --- a/testing/test_metal_surface.mm +++ b/testing/test_metal_surface.mm @@ -9,7 +9,7 @@ #include "third_party/skia/include/core/SkSurface.h" -namespace flutter { +namespace flutter::testing { bool TestMetalSurface::PlatformSupportsMetal() { return true; @@ -52,4 +52,4 @@ return impl_ ? impl_->GetTextureInfo() : TestMetalContext::TextureInfo(); } -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_metal_surface_impl.h b/testing/test_metal_surface_impl.h index fb96891e930ae..c3fdea24906dc 100644 --- a/testing/test_metal_surface_impl.h +++ b/testing/test_metal_surface_impl.h @@ -11,7 +11,7 @@ #include "third_party/skia/include/core/SkSurface.h" -namespace flutter { +namespace flutter::testing { class TestMetalSurfaceImpl : public TestMetalSurface { public: @@ -52,6 +52,6 @@ class TestMetalSurfaceImpl : public TestMetalSurface { FML_DISALLOW_COPY_AND_ASSIGN(TestMetalSurfaceImpl); }; -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_ diff --git a/testing/test_metal_surface_impl.mm b/testing/test_metal_surface_impl.mm index 8aac97463f666..85e745020b6ca 100644 --- a/testing/test_metal_surface_impl.mm +++ b/testing/test_metal_surface_impl.mm @@ -22,7 +22,7 @@ static_assert(__has_feature(objc_arc), "ARC must be enabled."); -namespace flutter { +namespace flutter::testing { void TestMetalSurfaceImpl::Init(const TestMetalContext::TextureInfo& texture_info, const SkISize& surface_size) { @@ -121,4 +121,4 @@ return IsValid() ? texture_info_ : TestMetalContext::TextureInfo(); } -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_metal_surface_unittests.mm b/testing/test_metal_surface_unittests.mm index 69bb436164089..975e4b03071e0 100644 --- a/testing/test_metal_surface_unittests.mm +++ b/testing/test_metal_surface_unittests.mm @@ -6,8 +6,7 @@ #include "flutter/testing/test_metal_surface.h" #include "flutter/testing/testing.h" -namespace flutter { -namespace testing { +namespace flutter::testing { #ifdef SHELL_ENABLE_METAL @@ -37,5 +36,4 @@ #endif -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_timeout_listener.cc b/testing/test_timeout_listener.cc index 1163c921e78e4..afe442508f5fb 100644 --- a/testing/test_timeout_listener.cc +++ b/testing/test_timeout_listener.cc @@ -7,8 +7,7 @@ #include #include -namespace flutter { -namespace testing { +namespace flutter::testing { class PendingTests : public std::enable_shared_from_this { public: @@ -120,5 +119,4 @@ void TestTimeoutListener::OnTestEnd(const ::testing::TestInfo& test_info) { }); } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_timeout_listener.h b/testing/test_timeout_listener.h index e6f466d92df2a..3a3872a952cfd 100644 --- a/testing/test_timeout_listener.h +++ b/testing/test_timeout_listener.h @@ -12,8 +12,7 @@ #include "flutter/fml/thread.h" #include "flutter/testing/testing.h" -namespace flutter { -namespace testing { +namespace flutter::testing { class PendingTests; @@ -38,7 +37,6 @@ class TestTimeoutListener : public ::testing::EmptyTestEventListener { FML_DISALLOW_COPY_AND_ASSIGN(TestTimeoutListener); }; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TEST_TIMEOUT_LISTENER_H_ diff --git a/testing/test_vulkan_context.cc b/testing/test_vulkan_context.cc index 084ac16deee10..b600707791d2f 100644 --- a/testing/test_vulkan_context.cc +++ b/testing/test_vulkan_context.cc @@ -22,8 +22,7 @@ #include "third_party/skia/include/gpu/vk/VulkanExtensions.h" #include "vulkan/vulkan_core.h" -namespace flutter { -namespace testing { +namespace flutter::testing { TestVulkanContext::TestVulkanContext() { // --------------------------------------------------------------------------- @@ -185,5 +184,4 @@ sk_sp TestVulkanContext::GetGrDirectContext() const { return context_; } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_vulkan_context.h b/testing/test_vulkan_context.h index ff82a858596ab..25a9d03a203aa 100644 --- a/testing/test_vulkan_context.h +++ b/testing/test_vulkan_context.h @@ -15,8 +15,7 @@ #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/gpu/ganesh/GrDirectContext.h" -namespace flutter { -namespace testing { +namespace flutter::testing { class TestVulkanContext : public fml::RefCountedThreadSafe { public: @@ -42,7 +41,6 @@ class TestVulkanContext : public fml::RefCountedThreadSafe { FML_DISALLOW_COPY_AND_ASSIGN(TestVulkanContext); }; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TEST_VULKAN_CONTEXT_H_ diff --git a/testing/test_vulkan_image.cc b/testing/test_vulkan_image.cc index 4c365412ae6ec..b1c04d50473bb 100644 --- a/testing/test_vulkan_image.cc +++ b/testing/test_vulkan_image.cc @@ -6,8 +6,7 @@ #include "flutter/testing/test_vulkan_context.h" -namespace flutter { -namespace testing { +namespace flutter::testing { TestVulkanImage::TestVulkanImage() = default; @@ -20,5 +19,4 @@ VkImage TestVulkanImage::GetImage() { return image_; } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_vulkan_image.h b/testing/test_vulkan_image.h index e0a030c8169df..53ba6871664ea 100644 --- a/testing/test_vulkan_image.h +++ b/testing/test_vulkan_image.h @@ -11,8 +11,7 @@ #include "flutter/vulkan/procs/vulkan_handle.h" #include "third_party/skia/include/core/SkSize.h" -namespace flutter { -namespace testing { +namespace flutter::testing { class TestVulkanContext; @@ -40,7 +39,6 @@ class TestVulkanImage { friend TestVulkanContext; }; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TEST_VULKAN_IMAGE_H_ diff --git a/testing/test_vulkan_surface.cc b/testing/test_vulkan_surface.cc index b8c8cd1fba395..1c68f7a7bc3ae 100644 --- a/testing/test_vulkan_surface.cc +++ b/testing/test_vulkan_surface.cc @@ -16,8 +16,7 @@ #include "third_party/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h" #include "third_party/skia/include/gpu/ganesh/vk/GrVkTypes.h" -namespace flutter { -namespace testing { +namespace flutter::testing { TestVulkanSurface::TestVulkanSurface(TestVulkanImage&& image) : image_(std::move(image)){}; @@ -110,5 +109,4 @@ VkImage TestVulkanSurface::GetImage() { return image_.GetImage(); } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/test_vulkan_surface.h b/testing/test_vulkan_surface.h index 51bed5bed07a0..f889f9f0df07a 100644 --- a/testing/test_vulkan_surface.h +++ b/testing/test_vulkan_surface.h @@ -13,9 +13,7 @@ #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/ganesh/GrDirectContext.h" -namespace flutter { - -namespace testing { +namespace flutter::testing { class TestVulkanSurface { public: @@ -36,7 +34,6 @@ class TestVulkanSurface { sk_sp surface_; }; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TEST_VULKAN_SURFACE_H_ diff --git a/testing/testing.cc b/testing/testing.cc index a12f6159cb29d..6fb2f4e33ffdf 100644 --- a/testing/testing.cc +++ b/testing/testing.cc @@ -9,8 +9,7 @@ #include "flutter/fml/file.h" #include "flutter/fml/paths.h" -namespace flutter { -namespace testing { +namespace flutter::testing { std::string GetCurrentTestName() { return ::testing::UnitTest::GetInstance()->current_test_info()->name(); @@ -121,5 +120,4 @@ bool MemsetPatternSetOrCheck(std::vector& buffer, MemsetPatternOp op) { return MemsetPatternSetOrCheck(buffer.data(), buffer.size(), op); } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/testing.h b/testing/testing.h index 369f66fbe5214..7a14ef2638a11 100644 --- a/testing/testing.h +++ b/testing/testing.h @@ -14,8 +14,7 @@ #include "gtest/gtest.h" #include "third_party/skia/include/core/SkData.h" -namespace flutter { -namespace testing { +namespace flutter::testing { const char* GetSourcePath(); @@ -115,7 +114,6 @@ bool MemsetPatternSetOrCheck(uint8_t* buffer, size_t size, MemsetPatternOp op); bool MemsetPatternSetOrCheck(std::vector& buffer, MemsetPatternOp op); -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_TESTING_H_ diff --git a/testing/thread_test.cc b/testing/thread_test.cc index 64b082f1805c7..1cfcfbb48cf95 100644 --- a/testing/thread_test.cc +++ b/testing/thread_test.cc @@ -6,8 +6,8 @@ #include "flutter/testing/thread_test.h" -namespace flutter { -namespace testing { +namespace flutter::testing { + namespace { fml::RefPtr GetDefaultTaskRunner() { @@ -31,5 +31,4 @@ fml::RefPtr ThreadTest::CreateNewThread( return runner; } -} // namespace testing -} // namespace flutter +} // namespace flutter::testing diff --git a/testing/thread_test.h b/testing/thread_test.h index 995bd45112a05..1ba0431ca9f97 100644 --- a/testing/thread_test.h +++ b/testing/thread_test.h @@ -14,8 +14,7 @@ #include "flutter/fml/thread.h" #include "gtest/gtest.h" -namespace flutter { -namespace testing { +namespace flutter::testing { //------------------------------------------------------------------------------ /// @brief A fixture that creates threads with running message loops that @@ -65,7 +64,6 @@ class ThreadTest : public ::testing::Test { FML_DISALLOW_COPY_AND_ASSIGN(ThreadTest); }; -} // namespace testing -} // namespace flutter +} // namespace flutter::testing #endif // FLUTTER_TESTING_THREAD_TEST_H_